![]() |
Tuesday, September 03, 2002 |
codaland had a link to an article on XML.com entitled "Transporting Binary Data in SOAP", where Rich Salz says: In the past we passed XML in string parameters, which interops well but is fat and destroys the fidelity of the contract. My belief is that XML parameters and return values should be passed as XML. While Rich's points about the complications of passing XML are all true, as are the simplifying assumptions, the code also models the XML parameters and return values as System.Xml.XmlElement types, i.e. XML Elements divorced from their owner douments. Document fragments is probably the more precise term. My employer has been taking on "early adopters" of our web services for the past month now. One thing we've discovered is that our customers don't know SOAP, and so we help get them started by writing sample code, the most useful part of which is the web service proxy code. One issue that I wish I'd investigated more is automated proxy generator support for the XSD <any/> element in schemas included in WSDL contracts. It seems like the toolkits out there choke on this. WSAD's proxy generator seems to skip it, Axis gives me stubs that return empty objects that implement java.io.Serializable, and Glue doesn't even seem to be able to parse the contract. Axis will understand that the following (assuming that you've declared xmlns:apachesoap="http://xml.apache.org/xml-soap") <s:element minOccurs="0" maxOccurs="1" name="Responses" type="apachesoap:Element"/>means that you want to pass org.w3c.dom.Element objects, but .NET and GLUE can't understand this. This approach to proxy generation is puzzling to me. It seems to me that if you were generating proxy code for a WSDL contract and you hit <any> in a schema, the easiest thing to do would be to delegate to the programmer; i.e. give the programmer an XML Element and make her figure out what to do with it. The alternative provided by Axis is no different (an empty object that the programmer has to hand serialize), though it's entirely possible that I'm missing the point. I'm now curious to see how Axis and Glue export org.w3c.dom.Element objects (I've used them only on the client side). 5:02:17 PM permalink
|