Java API for XML Web Services

The Java API for XML Web Services ( JAX -WS) is a Java API for building Web services. JAX -WS was introduced in the Java Platform, Enterprise Edition 5 and since version 1.6 also part of the Java Platform, Standard Edition.

JAX -WS is based on JAX -RPC, is part of the Web Services Interoperability Technology and thus also part of the Metro platform. Like other Java EE APIs also used JAX-WS annotations to simplify the development and deployment of web service clients and service endpoints.

How JAX -WS

Client and endpoint communicating via SOAP messages. JAX -WS uses SAAJ to create SOAP messages. JAX -WS is protocol - and transport-independent. By default, however, SOAP 1.1 and HTTP.

In order to process the data correctly, the XML data types must be converted to Java - compliant data types. The delegates of JAX -WS to JAXB (Java Architecture for XML Binding). Thus, the XML processing is essentially hidden from the programmer.

Creating web service endpoints and clients

Server side

There are two different ways to build service endpoints: Code First ( Bottom Up ) about POJOs and Contract First (Top Down) via WSDL.

Start with POJOs ( Bottom Up )

In contrast to the previous mode of development (JAX -RPC ) in which to create a web service end point defines an interface and a class is written which implements the interface can at JAX -WS just POJOs that are already available in an application that uses be. To facilitate this, they are extended by Java annotations to a web service. The deployment descriptors are redundant by the annotation.

Start with WSDL (top down )

Classes are generated from the WSDL description of the service interfaces, and supplemented by the user.

Client side

On the client side, a local proxy object must be created, which is also the interface of the web service implemented (generated from WSDL ). In JAX -WS, the client does not bring his proxy from a factory. He constructs a service object with the new operator calls the getServicePort method on to get a proxy, and performs its method calls on the proxy object, as if the web service available locally. The JAX -WS runtime sends the calls further from the proxy object to the web service, which then performs the operations and sends back the result to the client.

Supported WS-* standards

The following WS- * standards are implemented in the reference implementation of JAX -WS:

Currently only WSDL 1.1 is supported, not WSDL 2.0.

432226
de