In addition to the usual synchronous mode of invocation, CXF also supports two forms of asynchronous invocation, as follows:
-
Polling approach - in this case, to invoke the remote operation, you call a special method that has no output parameters, but returns a
javax.xml.ws.Response
instance. TheResponse
object (which inherits from thejavax.util.concurrency.Future
interface) can be polled to check whether or not a response message has arrived. -
Callback approach - in this case, to invoke the remote operation, you call another special method that takes a reference to a callback object (of
javax.xml.ws.AsyncHandler
type) as one of its parameters. Whenever the response message arrives at the client, the CXF runtime calls back on theAsyncHandler
object to give it the contents of the response message.
Both of these asynchronous invocation approaches are described here and illustrated by code examples.