Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
maxLevel2
typelist
separatorpipe

JAXB

...

migration

The most notable change in JAX-WS 2.0 is the use of JAXB 2.0 for data-binding between Java and XML. JAX-RPC 1.0 specified a limited mapping between XML and Java.
This effectively eliminates the need of using JAX-RPC mapping file where we define the mapping between Java and WSDL, but also imposes a condition that the return and request values can be able to bind to JAXB. Again, considering the wide variety of data types supported by JAXB it shouldn't be a problem.

...

JAX-WS 2.0 relies heavily on the use of Annotations. These annotations are used to customize the mapping from JAVA to XML schema/WSDL and are used at runtime to create the necessary files.
Geronimo uses the Sun provided wsgen utility to create the WSDL and stubs on the fly at the deploy time by processing the annotations specified.

SOAP

...

standards

JAX-RPC and JAX-WS both support SOAP 1.1. The default binding supported by JAX-WS is SOAP 1.1 over HTTP. But it can also support SOAP 1.2 binding over HTTP. As a Java programmer you might not encounter any difference between SOAP 1.1 and SOAP 1.2.

...

Also, a JAX-WS SEI makes extensive use of annotations to specify the Java to WSDL mapping whereas this information does not exist in any form of JAX-RPC SEI (which requires JAX-RPC mapping file to map Java to WSDL).

Deployment

...

descriptor

The deployment descriptor web.xml hasn't changed from JAX-RPC to JAX-WS where we just need to expose a POJO class as a servlet and the server creates the artifacts on the fly whereas for JAX-RPC we need to specify the WSDL and JAX-RPC mapping file locations.
With JAX-WS mapping to Java EE 5 and taking the advantage of annotations, the need for Web Service descriptor document webservices.xml is eliminated as a Web Service can be effectively described using the annotations.

Client

...

port lookup

The following code samples demonstrate the difference between JAX-RPC and JAX-WS in client port lookup.

...

  • The creation of ServiceFactory instance is no longer required for creating the Service
  • Service maps to javax.xml.rpc.Service in JAX-RPC and to javax.xml.ws.Service in JAX-WS.

RESTful

...

services

JAX-WS introduced RESTful Web Services as successor for SOAP based Web Service. RESTful services already got quite support from many vendors like Google AdSense, Yahoo API's, Amazon and so on.
The important things that are introduced in JAX-WS to support RESTful services are:

...

The Dispatch API is intended for advanced XML developers who prefer to use XML constructs at the java.lang.transform.Source or javax.xml.soap.SOAPMessage level. For added convenience use of the Dispatch API with JAXB data-bound objects is supported.

Asynchronous

...

operations

A major difference in operation mapping for JAX-WS over JAX-RPC is the introduction of asynchronous operations. Any WSDL operation with a two-way message flow, or one where the client expects to receive a response, can be mapped to an asynchronous Java representation.
For further reference about asynchronous operations in JAX-WS refer to the references section.

...