What is the best Java OXM library?

Despite being a developer for a while, I was fortunate enough to avoid a lot of work with XML. So now I have a project in which I have to interact with some web services, and would like to use some kind of solution to map objects to XML.

The only thing I know is JAXB. Is this the best way to go? Are there any other recommendations?

One catch - I'm stuck using Java 1.4, so I can't do anything with annotations.

+6
java oxm
source share
4 answers

If you are calling a web service with WSDL, JAXB is the best option. Take a look at wsimport and you'll be working in 10 minutes.

I don't think JAXB 2.0 will be possible on Java 1.4. You may need to use Axis:

java -cp axis-1.4.jar;commons-logging-1.1.jar;commons-discovery-0.2.jar;jaxrpc-1.1.jar;saaj-1.1.jar;wsdl4j-1.4.jar;activation-1.1.jar;mail-1.4.jar org.apache.axis.wsdl.WSDL2Java http://someurl?WSDL 

This will lead to the creation of similar stubs for JAXB.

If you do not have WSDL or XSD, you can always generate one .

+6
source share

JAXB is the best choice:

EclipseLink JAXB (MOXy) - best implementation:

MOXy is a JAXB implementation with extensions

MOXy has an external configuration file (based on JAXB annotations with extensions):

Has an XPath-based mapping for deep mapping:

Designed to process displayed ORM objects, including support for bidirectional relationships:

+10
source share

There is an XStream . It seems I remember that I used it many centuries ago, and everything was fine. I can’t say that I have enough experience to recommend it for or against, but it’s worth checking as an alternative.

+3
source share

JIBX - known for performance

JAXB2 - Ease of Use

Castor - Ease of Use

others - XMLBean, Xstream

+3
source share

All Articles