Skip to main content

Asynchronous invocation

Dispatch objects also support asynchronous invocations. As with the higher level asynchronous APIs discussed in Chapter 4, Dispatch objects can use both the polling approach and the callback approach.

When using the polling approach the invokeAsync() method returns a Response<t> object that can be periodically polled to see if the response has arrived.

Response <T> invokeAsync(T msg)
throws WebServiceException;

When using the callback approach the invokeAsync() method takes an AsyncHandler implementation that processes the response when it is returned.

Future<?> invokeAsync(T msg, AsyncHandler<T> handler)
throws WebServiceException;
Information noteNote: As with the synchronous invoke() method, the type of the response and the type of the request are determined when you create the Dispatch object.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!