||
Skip to end of metadata
Go to start of metadata

This sample illustrates the use of JAX-WS asynchronous invocation model using Document/Literal Style.

For more information on asynchronous invocation, refer to the JAX-WS 2.0 specification here: http://jcp.org/aboutJava/communityprocess/pfd/jsr224/index.html)  

The asynchronous model allows client threads to continue after making a two-way invocation, without being blocked while awaiting a response from the server. Once the response is available, it is delivered to the client application asynchronously, using one of two alternative approaches as follows:  

  • Callback: the client application implements the "javax.xml.ws.AsyncHandler" interface to accept notification of the response availability. 
  • Polling: the client application periodically polls a "javax.xml.ws.Response" instance to check if the response is available.

This Sample illustrates both approaches. Additional methods are generated on the Service Endpoint Interface (SEI) to provide this asynchrony, named by convention with the suffix "Async". As many applications will not require this functionality, the asynchronous variants of the SEI methods are omitted by default to avoid loading the SEI with unnecessary baggage. In order to enable generation of these methods, a bindings file (wsdl/async_bindings.xml) is passed to the wsdl2java generator.

Building and running the sample

This sample can be found at <AS_HOME>\samples\Jaxws-Jaxrs\async_jaxws

For information on building and running the sample, see Building and Running JAX-WS Samples.

  • No labels