Whats the right choice for me for building Web Service using Axis2 - AXIOM, JAXB, ADB or XMLBeans
Asked Answered
M

1

7

Axis2 supports Web Service creation using AXIOM, JAXB, ADB and XMLBeans. I am new in this area of Web Service development and want to create a Web Service using Axis2. The web service is going to be very simple but I am expecting it to change quite frequently. I felt AXIOM is good as it allows you to specify your service requirements in service.xml file and then creates it accordingly for you. So I thought this will make my life easier as in future for any change in my web service I only need to change service.xml file and some code in by .java classes for web services. But other methods have their own advantages too. Considering my requirements, can you tell me which method should I adopt in creating the web service? Note: I would love to extend support for both REST and SOAP Web Service.

Motor answered 16/2, 2011 at 23:13 Comment(0)
C
8

I'll start by admitting my bias that I lead the MOXy JAXB implementation, which leads me into my first point.

1. There are multiple JAXB implementations

Since JAXB is a standard (JSR-222), there are multiple implementations: Metro (the reference implementation), EclipseLink MOXy, Apache JaxMe, etc. If you hit a show stopper bug in one implementation you can try another.

2. JAXB is the default binding layer for both JAX-RS (RESTful Web Services) and JAX-WS (SOAP Web Services)

JAXB was designed in conjunction with JAX-WS, and JAX-RS was written to leverage JAXB. JAXB is supported on all Java EE 5 and Java EE 6 application servers.

3. JAXB supports Java 5 features such as generics and enums

This may or not be a big deal for you, but JAXB supports generics and enums while XML Beans does not.

4. Individual Implementations have very useful extensions

For example MOXy has extensions for XPath based mapping, XML metadata file, and extensions for mapping JPA entities:

Cool answered 17/2, 2011 at 0:12 Comment(2)
@Blaise Doughan does this mean that ADB is actually JAXB? Because neither JAXB or JaxMe are mentioned as options in the "[Apache Axis 2 ?User Guide]"(axis.apache.org/axis2/java/core/docs/…). ?:-SBaleful
@ArtB - ADB is a proprietary object-to-XML solution. JAXB is an XML binding standard with several implementations: Metro, MOXy, JaxMe. Axis supports JAXB as outlined here: axis.apache.org/axis2/java/core/docs/jaxws-guide.htmlCool

© 2022 - 2024 — McMap. All rights reserved.