boolean status = true;
// let's get our thread local context
WebServiceEngineImpl wsEngine = WebServiceEngineImpl.getInstance();
try {
if (!listeners.isEmpty() || wsEngine.hasGlobalMessageListener()) {
String messageID = (String) messageContext.get(EndpointImpl.MESSAGE_ID);
// someone is listening ?
if (messageID!=null) {
HttpServletRequest httpReq = (HttpServletRequest) messageContext.get(MessageContext.SERVLET_REQUEST);
HttpRequestInfoImpl info = new HttpRequestInfoImpl(httpReq);
wsEngine.processRequest(messageID, messageContext, info);
}
// any local listeners ?
if (!listeners.isEmpty()) {
// create the message trace and save it to our message context
MessageTraceImpl request = new MessageTraceImpl();
request.setEndpoint(this);
request.setMessageContext(messageContext);
HttpServletRequest httpReq = (HttpServletRequest) messageContext.get(MessageContext.SERVLET_REQUEST);
request.setTransportInfo(new HttpRequestInfoImpl(httpReq));
messageContext.put(EndpointImpl.REQUEST_TRACE, request);
}
}
} catch(Exception e) {
wsEngine.sLogger.warning("Exception while tracing request : " + e.getMessage());
throw e;
}
return status;