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.
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:
© 2022 - 2024 — McMap. All rights reserved.