Home

 

Creating asynchronous Web service clients

An asynchronous invocation of a Web service sends a request to the service endpoint and then immediately returns control to the client program without waiting for the response to return from the service. JAX-WS asynchronous Web service clients consume Web services using either the polling approach or the callback approach:

Using a polling model, a client can issue a request and receive a response object that is polled to determine if the server has responded. When the server responds, the actual response is retrieved.

Using the callback model, the client provides a callback handler to accept and process the inbound response object. The handleResponse method of the handler is called when the result is available.

Both the polling and callback models enable the client to focus on continuing to process work without waiting for a response to return, while providing for a more dynamic and efficient model to invoke Web services.

ibm.com/redbooks