I am a JAX-RPC user with interoperability concerns. The JAX-RPC implementations I've come across make it convenient to build and use a Web service whose interface makes use of Java collection classes such as Map, List and Set. My question is this: By incorporating these classes into the signatures of methods of my service interface, am I breaking my chances of interoperability with clients that use other platforms, specifically .NET? What does the WS-I Basic profile say about this? Should I steer away from using anything other than arrays as far as collections are concerned?
WS-I has not yet tackled the collections/containers problem (and I'm not sure they will). Most Java implementations provide serialization frameworks that automatically map a Java collection to an XML container. Likewise .NET provides automatic serialization frameworks that map .NET collections to XML containers. An interoperability issue can arise if the Java-generated containers aren't compatible with the .NET-generated containers. In particular, the Apache containers (used by Apache Axis and Sun's JAX-RPC RI) aren't compatible with the .NET containers. You can readily resolve this issue by using custom serialization routines, but then you lose the advantages of using the automatic serialization frameworks, and you also need to configure your clients and services to use special serializers.
Quite a few Java implementations, such as GLUE, WASP, and XMLBus provide serialization frameworks that can generate containers that are compatible with either Apache or .NET containers. (You have to choose which one you want -- unfortunately you can't generate a container that is compatible with both.) If you use these implementations with the .NET-compatible containers, you shouldn't have interoperability problems with .NET, and you won't need to create custom serializers.
Your other choice is avoid the whole situation by simply using arrays rather than collections.
Dig Deeper on Topics Archive
Edmund Smith, a software engineer at EMB, in Cambridge, England, recently co-authored a white paper, "Rethinking the Java SOAP Stack," with Steve Loughran, a scientist from HP Labs in Bristol, England. In the white paper, the authors make the argument that the Java application programming interface (API) for XML-based Remote Procedure Call (RPC), formerly known as JAX-RPC (now JAX-WS), is fundamentally flawed. Moreover, they claim that any SOAP API that relies on a perfect two-way mapping between XML data and native language objects is flawed.
The authors have proposed an alternative SOAP stack for Java, dubbed Alpine, which takes a more document-centric approach to Web services development. Rather than mapping between XML and custom Java classes, Alpine will provide access to SOAP messages using modern XML support libraries. Alpine will require an understanding of XML, which the authors claim is needed to develop robust Web services, and they advocate that Web services developers should acquire that skill.
Related Q&A from Anne Thomas Manes
Anne Thomas Manes explains the differences between open source clients and open source implementations. Continue Reading
Anne Thomas Manes discusses the best way to go about creating an enterprise data dictionary and why the systems works well. Continue Reading
Anne Thomas Manes explains the difference between 'hard' real time and 'live' real time systems. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.