+

Search Tips   |   Advanced Search

JAX-WS client programming model

JAX-WS client programming supports synchronous and asynchronous invocation of JAX-WS web services using either...


Dispatch client

Although not generally necessary, you may want to work at the XML message level. Support for invoking services at the XML message level is provided by the Dispatch client API, javax.xml.ws.Dispatch. To write a Dispatch client, have expertise with...

The Dispatch client can send data in either MESSAGE or PAYLOAD mode.

With javax.xml.ws.Service.Mode.MESSAGE mode, the Dispatch client provides the entire SOAP envelope including the <soap:Envelope>, <soap:Header>, and <soap:Body> elements.

Weith javax.xml.ws.Service.Mode.PAYLOAD mode, the Dispatch client provides the contents of the <soap:Body>, and JAX-WS includes the payload in a <soap:Envelope> element.

The Dispatch client API requires application clients to construct messages or payloads as XML which requires knowledge of the message or message payload. The Dispatch client supports the following types of objects:

For example, if the input parameter type is javax.xml.transform.Source, the call to the Dispatch client API is similar to the following code example:

The Dispatch parameter value determines the return type of the invoke() method.

The Dispatch client is invoked in one of three ways:

Refer to Chapter 4, section 3 of the JAX-WS specification for more information on using a Dispatch client.


Dynamic Proxy client

The static client programming model for JAX-WS is the called the Dynamic Proxy client.

The Dynamic Proxy client invokes a web service based on a Service Endpoint Interface (SEI) dynamically generated at run time from a WSDL file

The Dynamic Proxy instances extend the java.lang.reflect.Proxy class, and leverage the Dynamic Proxy function in the base JRE 6. The client application can provide an interface used to create the proxy instance, while the runtime is responsible for dynamically creating a Java object representing the SEI.

The Dynamic Proxy client is invoked in one of three ways:

Refer to Chapter 4 of the JAX-WS specification for more information on using Dynamic Proxy clients.


JAX-WS

  • Implement static JAX-WS web services clients
  • Develop a JAX-WS client from a WSDL file
  • Invoking JAX-WS web services asynchronously
  • Web services specifications and APIs
    JAX-WS API documentation
    JAX-WS API User's Guide documentation