log.debug("Async invocation of the endpoint was successful. Creating response message.");
}
response = createResponse(request, params, output);
}
EndpointInvocationContext eic = null;
if (request.getInvocationContext() != null) {
eic = (EndpointInvocationContext) request.getInvocationContext();
eic.setResponseMessageContext(response);
}
EndpointCallback callback = eic.getCallback();
boolean handleFault = response.getMessage().isFault();
if (!handleFault) {
if (log.isDebugEnabled()) {
log.debug("No fault detected in response message, sending back application response.");
}
callback.handleResponse(eic);
}
else {
if (log.isDebugEnabled()) {
log.debug("A fault was detected. Sending back a fault response.");
}
callback.handleFaultResponse(eic);
}
// Set the thread's ClassLoader back to what it originally was.
Thread.currentThread().setContextClassLoader(currentLoader);
// Clean up the cached attachments from the request and the response.
TransportUtils.deleteAttachments(eic.getRequestMessageContext().getAxisMessageContext());
TransportUtils.deleteAttachments(eic.getResponseMessageContext().getAxisMessageContext());
} catch (Throwable e) {
// Exceptions are swallowed, there is no reason to rethrow them
if (log.isDebugEnabled()) {
log.debug("AN UNEXPECTED ERROR OCCURRED IN THE ASYNC WORKER THREAD");
log.debug("Exception is:" + e, e);