Simon Fell > Its just code : Saturday, December 28, 2002

Simon Fell > Its just code

Saturday, December 28, 2002

Rss Validator

I patched my copy of PocketSOAP to workout the chunked problem below, so I could finish the sample. I ran the WSDL through the RC1 tool [a local copy of the WSDL with a couple of fixes in], then added the DOMElement serializer class, which is just a class with

Implements ISoapSerializer
Private Sub ISoapSerializer_Serialize(Val As Variant, _
                                      ByVal ctx As PocketSOAP.ISerializerContext, _
                                      ByVal dest As PocketSOAP.ISerializerOutput)
    Dim n As MSXML2.IXMLDOMElement
    Set n = Val 
    dest.WriteTextNoEncoding n.xml
End Sub
Tweaked the generated configuration code by removing the code it generated for the request class, and added a line to register the new serializer
m_sf.Serializer "{2933BF86-7B36-11D2-B20E-00C04F983E60}", "", "", "Rss.s_DOMElement"
and finally tweaked the generated method stub, so that it was a bit smarter, you can pass a DOM, or a fileName/URL and it'll load it for you. That wraps up the proxy object. The calling app is then straightfoward enough
Private Sub Command1_Click()
    Dim v As New Rss.Validator
    Dim vr As Rss.Response
    Set vr = v.Validate(tFile.Text)
    Dim i As Long
    List1.Clear
    On Error GoTo emptyArray
    For i = LBound(vr.Message) To UBound(vr.Message)
        printMsg vr.Message()(i), i
    Next
    Exit Sub
emptyArray:
        List1.AddItem "No Errors !"
End Sub
When the chunked encoding issue is resolved one way or the other, I'll post all the code to the samples site.
< 10:00:18 PM  # more elsewhere > Greg Long - Temporary (Groove Salad: a nicely chilled plate of ambient beats and grooves. [SomaFM])

Chunked encoding Almost have the RSS Validator sample done, I'm generating a valid request (the required DOM Serializer class weights in at 3 lines of VB), but the response uses chunked encoding which shouldn't be a problem, PocketSOAP can handle that, but the server doesn't appear to be following the HTTP spec, in particular i get
Transfer-Encoding: chunked
Content-Type: text/xml
dd
<?xml version ....
What you can't see is that the chunk length (dd in this case) is followed by a space character before the CRLF bytes. (the hex viewer in YATT is a wonderful thing!). Looking at the spec for chunked encoding and the relevant BNF, I see nothing that says that white space is valid in that position. Did I miss something, or is this broken ?
< 8:31:33 PM  # more elsewhere > Various Artists - A Grain Of Sand (Groove Salad: a nicely chilled plate of ambient beats and grooves. [SomaFM])

Rss Validator Sam Ruby asks if the WSDL wizard can handle the SOAP interface to the RSS validator. The short answer is no. The problem is this

<xsd:complexType name="Request">
  <xsd:sequence>
    <xsd:any namespace="##other"/>
  </xsd:sequence>
</xsd:complexType>

There's no built in support for xsd:any at this point, largely because there is no single COM based DOM implementation available for all the platforms PocketSOAP supports. Does that mean you can't use PocketSOAP with the RSS validator, no, it just means its slightly more work. I'll put together a sample for it.
< 8:01:08 PM  # more elsewhere >

MSNAmp Seems to be a day for shipping code, I updated MSNAmp so that you can configure how it builds your display name. Look at the MSNAmp preference panel in Winamp for details.
< 6:15:48 PM  # more elsewhere > Amon Tobin - Chronic Tronic (from Out From Out Where)

WSDL Finally wrapped up RC1 of the WSDL Wizard. It supports doc/lit and rpc/encoded, SOAP headers, enumerations, complex types and import [most of the stuff that auto-gen'd WSDL uses, but not everything in XSD]
< 5:01:14 PM  # more elsewhere > Kiril Dzajkovski - Swimmer (Secret Agent 128k: The soundtrack for your stylish, mysterious, dangerous life. For Spys and P.I.'s too! [SomaFM])

TcpTrace As Tomas asked nicely, I just posted v0.7.3 of TcpTrace. Keep those suggestions rolling in!.
TcpTrace
< 3:24:12 PM  # more elsewhere > Propellerheads - Spybreak! (Secret Agent 128k: The soundtrack for your stylish, mysterious, dangerous life. For Spys and P.I.'s too! [SomaFM])

TcpTrace Just posted v0.7.2 which adds the option to fix up linefeeds from non-windows platforms so that they display properly. Thanks to Eric Promislow for the suggestion.
< 11:27:52 AM  # more elsewhere > Batidos - Olajope (Secret Agent 128k: The soundtrack for your stylish, mysterious, dangerous life. For Spys and P.I.'s too! [SomaFM])