Tuesday, July 31, 2012

Developing Scalable Asynchronous JAX-WS Clients (Asynchronous Client Transport)

The asynchronous client transport feature provides a scalable asynchronous client programming model. Specifically, this feature:
  • Publishes a client-side asynchronous response endpoint, shown in Figure 3-1.
  • Creates and publishes a service implementation that invokes the requested asynchronous handler implementation.
  • Automatically adds WS-Addressing non-anonymous ReplyTo headers to all non-one-way, outbound messages. This header references the published response endpoint.
  • Correlates asynchronous request and response messages using the facilities listed above.
When the asynchronous client transport feature is enabled, all other JAX-WS client programming models (such as asynchronous polling, callback handler, dispatch, and so on) continue to be supported. Synchronous Web service operations will, by default, use synchronous transport, unless explicitly configured to use asynchronous client transport feature when enabling the feature.
The following figure shows the message flow used by the asynchronous client transport feature.
Figure 3-1 Asynchronous Client Transport Feature
Description of Figure 3-1 follows
Description of "Figure 3-1 Asynchronous Client Transport Feature"
As shown in the previous figure:
  1. The client enables the asynchronous client transport feature on the client proxy and invokes an asynchronous Web service operation.
  2. The Web service operation is invoked via the client proxy.
  3. The Web service processes the request and sends a response message (at some time in the future) back to the client. The response message is sent to the client's asynchronous response endpoint. The address of the asynchronous response endpoint is maintained in the WS-Addressing headers.
  4. The response message is forwarded to the appropriate client via the client proxy.
  5. The client asynchronous handler is invoked to handle the response message.

No comments:

Post a Comment