JAX-WS Advantage over JAX-RPC
SOA involves the use of loosely coupled, independent application services made available across a network. These services communicate via a standardized, platform-independent protocol that hides the underlying implementation details of each service. So a .NET client can access a service implemented in Java.
1- JAX-WS is typically used in conjunction with other technologies.
2- JAX-WS represents remote procedure calls or messages using XML-based protocols such as SOAP, but hides Soap's innate complexity behind a Java-based API.
3- The JAX-WS runtime system converts API calls and matching replies to and from SOAP messages.
4- Invoking Web services asynchronously.
JAX-WS Advantage over JAX-RPC:
1- Using JAX-WS API, development of Web services and clients is simplified with better platform independence for Java applications. JAX-WS takes advantage of the dynamic proxy mechanism to provide a formal delegation model with a pluggable provider. This is an enhancement over JAX-RPC, which relies on the generation of vendor-specific stubs for invocation.
2- JAX-RPC and JAX-WS support SOAP 1.1 and also supports SOAP 1.2.
3- 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.
4- JAX-WS's data mapping model is JAXB. JAXB promises mappings for all XML schema's.
5- JAX-RPC handlers rely on SAAJ 1.2. JAX-WS handlers rely on the new SAAJ 1.3 specification.
6- JAX-WS also adds a dynamic server model, which JAX-RPC does not have.
7- JAX-WS provides a new dynamic Dispatch client API that is more generic and offers more flexibility than the existing Java API for XML-based RPC (JAX-RPC)-based Dynamic Invocation Interface (DII). The Dispatch client interface, javax.xml.ws.Dispatch, is an XML messaging oriented client that is intended for advanced XML developers who prefer to work at the XML level using XML constructs. The Dispatch API can send data in either PAYLOAD or MESSAGE mode.
8- JAX-WS supports the use of SOAP Message Transmission Optimized Mechanism (MTOM) for sending binary attachment data. By enabling MTOM, you can send and receive binary data optimally without incurring the cost of data encoding to ensure the data is included in the XML document.