JAX-WS (Java architecture for Web Services) is a follow-on version of Jax-RPC. It is a standards-based API that you can use to write, assemble, and deploy Java WEB services. JAXB (Java architecture for XML Binding) is a java/xml binding technique. JAX-WS will use JAXB to handle all Java-bound operations.
This article will briefly describe the JAX-WS 2.0 and JAXB 2.0 that are supported in Bea WebLogic Server 10.1. Readers can get started with the sample code in the article.
JAXB 2.0 Java Developer Quick Guide
JAX-WS uses JAXB to handle all Java binding operations, so this article will focus on JAXB, which is related to JAX-WS. Skilled Java developers are usually very busy. With this in mind, I will focus on the following two areas:
Current tasks that can be accomplished using JAXB 2.0.
Currently using JAXB 2.0 cannot complete the task.
If you are too busy to read this article, download the sample code provided in this article directly. The Readme file in the package describes the specific steps to be done.
What are the tasks you can do with JAXB 2.0?
The following is a list of some of the more interesting tasks you can achieve with JAXB 2.0. I don't mean to say that you can't do this with other Java-to-xml/xml-to-java binding techniques. I'm just listing the actions you can do with JAXB 2.0:
Generates a Java object graph from a WSDL that contains one or more <xs:schema> elements. These <xs:schema> elements can refer to other <xs:schema> elements using <xs:import> and <xs:include> elements.
Generates an XML Schema document from a Java object graph.
Use the Quick Information Set Analyzer (SAX and Stax) and the serial (serializer).
An XML information set that randomly accesses an XML document.
Embed a binding declaration directly in an XML schema file or an external bound customization file.
Use an event-based flow model when ungrouping (unmarshalling).
Marshalling binary data (for example, processing Mtom and MIME attachments).
Develop your own plug-ins to extend the JAXB code generation functionality. These plug-ins, which are encapsulated in a. jar file as a class, can then access the JAXB-generated code and generate additional classes/methods/fields/comments/comments.
Write custom code to convert an existing class into a class generated by the JAXB schema compiler.
Operations that cannot be completed using JAXB 2.0
The following is a list of actions that cannot be performed using JAXB 2.0 (or I do not know how to do this):
Generates an XML schema from an XML document. In fact, it's not a big deal. This can be accomplished by other tools, such as Stylus Studio, XMLSpy, and Xmlbuddy Pro.
Match the performance index of Stax or sax parsing. When parsing the same XML document, Sax requires a 46ms 10ms,stax, while JAXB 2.0 requires 59ms.
Example of Java binding using JAXB Pojo JAX-WS Web Service
JAX-WS is a standards-based API that you can use to write, assemble, and deploy Java WEB services. It uses JAXB to handle all Java-bound operations associated with this. Jax-ws 2.0/2.1 does not support the use of JAX-RPC or Apache beehive Xmlbean types, but only for JAXB-type Xmlbean.