Problem solve Get help with specific problems with your technologies, process and projects.

Java collection classes and interoperability

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

The case for document-centric Web services development

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.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.