views:

2585

answers:

5

Which Java SOAP XML object serialization library would you recommend for Java object exchange with other platforms / languages (.NET, Delphi)?

Communication scenarios could look like this:

  • Java object writer -> SOAP XML text -> .NET or Delphi object reader
  • .NET or Delphi object writer -> SOAP XML text -> Java object reader

I know there is the XStream XML serialization library and JSON as alternative solutions, however since Delphi and .Net have built-in support for SOAP XML serialized objects, this would offer a 'standardized' way with support for advanced features like nested objects, arrays and so on.

Edit: Meanwhile, I found JAXB - (https://jaxb.dev.java.net/), JAXMe, and JiBX - Binding XML to Java Code(http://jibx.sourceforge.net/). But they do not generate SOAP serialized XML by default.

A possible solution would be a web service library which is able to run without a HTTP server, and offers a simple file interface for the SOAP XML content (not a complete request, just a serialized object). Axis 2 and CXF look very interesting.

A: 

The standard library for this would probably be Apache Axis[1]. I would advise using axis2 instead of axis 1.4- though it works pretty well.

Bearing in mind that the all of the SOAP extensions make the dream of interoperability just that... a dream.

+3  A: 

In addition to Axis2 which works ok, Sun's JAX-WS (version 2) and Apache CXF (nee XFire) are worth checking out, it Soap is your thing. CXF may be the most mature of the 3, so that's my favorite, but all 3 are pretty good.

StaxMan
+1 for axis2, -1 for jax-ws
Mike Miller
+5  A: 

I prefer JAX-WS (with JAXB 2.1 databinding) over the other liberaries I've used (JAX-RPC, Axis 1 and 2, but not XFire). The JAXB 2 databinding uses generics, which makes for a pleasant mapping of properties with a maxoccurs > 1. JAX-WS itself is reasonably well documented and provides a reasonably good API. The method and parameter annotations can get a bit out of hand in some cases - XML hell in annotation form. It usually isn't so bad.

One of the nice aspects of the JAX-WS stack is project Metro, which Sun co-developed with Microsoft and interoperates well with the web service support .NET 3.0, going so far as to implement MTOM in a workable fashion.

Barend
+1 for JAX-WS and JAXB. Sometimes you have to really dabble with the annotations, but in the end I was really pleased with the result
Martin Lazar
+3  A: 

I would recommend CXF. It is a very good services stack and includes JAXB data binding and JAX-WS support. You may want to look at an open source integration platform like Mule that includes CXF (also supports Axis and XStream) if you need more advanced transformation and routing of your messages. It is lightweight and can be embedded or run without an app server.

Ken
CXF is my favorite at the moment too, new but very feature rich
mjustin
Plenty easy to use, and you can just concentrate on your java code and let CXF deal with web service twaddle.
Martlark
A: 

I think you have answered your own question.

XStream (outputting as JSON) is a nice clean solution. If you alias types you get a clean output format. After that it doesn't matter which SOAP stack you use so long as it is nice and interoperable with Delphi/.NET.

Fortyrunner
I would recommend against this. XStream is a great lib for serializing POJOs as xml, but not if one wants to use SOAP (same goes for JSON as format of course).
StaxMan