Java Web Services

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I'm mucking around with a little app for Google Android. It requires a back-end web service running under Apache, so I figured I might as well do that in Java as well.

Is JAXB the right way to proceed? In other words, define the transactions I need in an XML schema and use JAXB to generate a Java binding, then fill that in? Or is there another approach that might be better? I should also mention I will be using MySQL for persistence.

Low overhead is important, so I am not so concerned with SOAP compliance or strict schema adherence.

Any thoughts very welcome.
 

Argo

Lifer
Apr 8, 2000
10,045
0
0
I would go JWS over Axis. Higher performance, and you can define you services via annotations and then build your wsdl/xsd.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Thanks for the replies, guys. In either case I think Tomcat would be the container, so it's a matter of choosing a framework for processing the SOAP messages.

Seems to me that JAXB and Axis are at different levels of abstraction. JAXB is a marshaller/unmarshaller for Java=>XML=>Java. Axis is a SOAP message processing engine that uses SAX internally for what is essentially marshalling and unmarshalling. It could use JAXB, and in fact I saw some forum posts hinting they might in the future.

The full JWS setup includes JAXB, as well as some other tools (SAAJ for example) that make up more than the total functionality of Axis. But Axis seems like it might be a more direct route, given that this code is for fun. Is it really slower than the equivalent processing using JAXB? In general I prefer a DOM rather than a SAX approach to XML processing, but for SOAP messages an event-based model actually makes a lot of sense.

In either case I will probably design the SOAP messages and WSDL first, and then generate the Java stubs from these, rather than annotating Java classes and methods.