Saturday, February 7, 2009

SCEA1.5 - Few Terms related to JAX-WS, JAX-RPC and JAXB

Reasons you may want to stay with JAX-RPC 1.1:
If you want to stay with something that's been around a while, JAX-RPC will continue to be supported for some time to come. If you don't want to step up to Java 5. If you want to send SOAP encoded messages or create RPC/encoded style WSDL.
Reasons to step up to JAX-WS 2.0:
If you want to use the new message-oriented APIs. If you want to use MTOM to send attachment data. If you want better support for XML schema through JAXB. If you want to use an asynchronous programming model in your Web service clients. If you need to have clients or services that can handle SOAP 1.2 messages. If you want to eliminate the need for SOAP in your Web services and just use the XML/HTTP binding. If you like playing with leading edge technology.
JAX-WS style of web services is built on JSR-224 specification.It uses annotations (JSR-181) and new data binding stack JAXB. JbossWS 2.0 >= series whichis used in this porting exercise is JAX-WS compliant.It supports SOAP 1.1 and SOAP 1.2.Their are quiet a few notable differences between JAX-WS and JAX-RPC.
1.2.1.1 SOAP 1.2
JAX-RPC and JAX-WS support SOAP 1.1. JAX-WS also supports SOAP 1.2.
1.2.1.2 XML/HTTP
The WSDL 1.1 specification defined an HTTP binding, which is a means by which you can send XML messages over HTTP without SOAP. JAX-RPC ignored the HTTP
binding. JAX-WS adds support for it.
1.2.1.3 WS-I's Basic Profiles
JAX-RPC supports WS-I's Basic Profile (BP) version 1.0. JAX-WS supports BP 1.1. (WS-I is the Web services interoperability organization.)
1.2.1.4 New Java features
JAX-RPC maps to Java 1.4. JAX-WS maps to Java 5.0. JAX-WS relies on many of the features new in Java 5.0.Java EE 5, the successor to J2EE 1.4, adds support for JAX-WS, but it also retains support for JAX-RPC, which could be confusing to today's Web services
novices.
1.2.1.5 The data mapping model
JAX-RPC has its own data mapping model, which covers about 90 percent of all schema types. Those that it does not cover are mapped to
javax.xml.soap.SOAPElement.
JAX-WS's data mapping model is JAXB. JAXB promises mappings for all XML schemas.
1.2.1.6 The interface mapping model
JAX-WS's basic interface mapping model is not extensively different from JAX-RPC's; however:
JAX-WS's model makes use of new Java 5.0 features.JAX-WS's model introduces asynchronous functionality.
1.2.1.7 The dynamic programming model
JAX-WS's dynamic client model is quite different from JAX-RPC's. Many of the changes acknowledge industry needs:
It introduces message-oriented functionality.It introduces dynamic asynchronous functionality.JAX-WS also adds a dynamic server model, which JAX-RPC does not have.
1.2.1.7 MTOM (Message Transmission Optimization Mechanism)
JAX-WS, via JAXB, adds support for MTOM, the new attachment specification. Microsoft never bought into the SOAP with Attachments specification; but it
appears that everyone supports MTOM, so attachment interoperability should become a reality.
1.2.1.8 The handler model
The handler model has changed quite a bit from JAX-RPC to JAX-WS.JAX-RPC handlers rely on SAAJ 1.2. JAX-WS handlers rely on the new SAAJ 1.3 specification.

Difference between original WSDL and modified WSDL
No import statement required hereHelloWorld is not a complex type but just an element, if it is complex type it adds another layer in SOAP PacketSimilarly HelloWorldRespons is not a complex type but just an element

JAXB: JAXB provides methods for unmarshalling XML instance documents into Java content trees,and then marshalling Java content trees back into XML instance documents. JAXB alsoprovides a way to generate XML schema from Java objects
JAXB 2.0 includes several important improvements to JAXB 1.0:¦ Support for all W3C XML Schema features. (JAXB 1.0 did not specify bindings for some ofthe W3C XML Schema features.)¦ Support for binding Java-to-XML, with the addition of the javax.xml.bind.annotationpackage to control this binding. (JAXB 1.0 specified the mapping of XML Schema-to-Java,but not Java-to-XML Schema.)
A significant reduction in the number of generated schema-derived classes.
Additional validation capabilities through the JAXP 1.3 validation APIs.
Smaller runtime libraries.

Unmarshalling: Unmarshalling provides a client application the ability to convert XML data into JAXB-derivedJava objects
Marshalling: Marshalling provides a client application the ability to convert a JAXB-derived Java object treeback into XML data.