Main BLOGGER
Google
WWW THIS BLOG
Friday, September 02, 2005
 
Document-based Web Services, My comment
Quoted from
http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns2/

The strategies associated with the Document-Based Web Services pattern examined here are:

1. Using XML in the SOAP Body
2. Using a String in the SOAP Body
3. Using base64Encoded or raw bytes in the SOAP body
4. Using the xsd:any Element in WSDL
5. Using the xsd:anyType in WSDL

I have tried 2,3,4,5 before in my XSharp Project.

Pattern 1 is trivial. It is just the usage of extension of WSDL, analog to the "#include" instruction in C/C++ or "import" in Java/C#.

Pattern 2 uses String to hide the fact that this is XML string on the wire. It needs end user to validate the XML string.

Pattern 3 has no significant difference from Pattern 2. The only difference is the on-the-wire String is encoded in Base64. But Base64 is originally designed to encode binary type to String.

Pattern 4 will lead to the further XML parsing automatically since it is converted to XML element. It is end user's reponsibility to parse the incoming XML element snippet.

Pattern 5 is kind of dynamic parsing. In .NET, since every class has a root class "System.object", it is "System.object" that handles the XML snippet. In practice, we can cast this "System.object" to an object with specific class type. During the casting, XML parsing runtime system will try to match the XML to that object. But in Java world, it is handled the same as Pattern 4. Notice that in "RPC/Encoded" mode, Java will map the XML element to "Java.lang.object" at first, and try the type casting just like .NET.



<< Home

Powered by Blogger

Google
WWW THIS BLOG