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
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.