"Asynchronous message exchange not enabled. The invocation will be synchronous.");
}
}
CallbackFuture cbf = null;
if (callback != null) {
cbf = new CallbackFuture(ic, callback);
} else {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("ICErr4"));
}
opClient.setCallback(cbf);
org.apache.axis2.context.MessageContext axisRequestMsgCtx = request.getAxisMessageContext();
try {
execute(opClient, false, axisRequestMsgCtx);
} catch (AxisFault af) {
if (log.isDebugEnabled()) {
log.debug(axisRequestMsgCtx.getLogIDString() + " AxisFault received from client: " +
af.getMessage());
}
/*
* Save the exception on the callback. The client will learn about the error when they try to
* retrieve the async results via the Response.get(). "Errors that occur during the invocation
* are reported via an exception when the client attempts to retrieve the results of the operation."
* -- JAXWS 4.3.3
*/
/*
* TODO: This is the appropriate thing to do here since the thrown exception may occur before
* we switch threads to the async thread. But... what happens if we've already switched over
* to the async thread? So far, it appears that the exception gets set on the FutureTask
* Concurrent object, and we never hit this scope. This means that later, when the client
* calls future.get(), no exception will be thrown despite what the spec says. The client can,
* however, retrieve errors via it's AsyncHandler.
*/
cbf.onError(af);
}
return cbf.getFutureTask();
}