throw new RuntimeException("Invalid SOAP envelope: no body element.");
Element requestData = XmlUtils.getFirstElement(body);
ResourceRouter router = getRouter();
Environment env = router.getEnvironment();
MessageHeaders addressing = null;
try
{
//
// WS-A info provides resource context for this request
//
addressing = new MessageHeaders(header);
env.addAddressingContext(addressing);
}
catch (Throwable error)
{
LoggingUtils.logError(router.getLog(), error);
}
if (!hasFailedToInitialize())
LoggingUtils.logMessage(router.getLog(), request, true);
//
// actually perform the operation with the given parameters
//
Element result = router.invoke(requestData);
//
// the standard response wsa:Action name is Action + "Response"
//
MessageHeaders replyAddressing = null;
//
// send back fault headers on exception
//
if (SoapUtils.isFault(result))
replyAddressing = addressing.createFaultHeaders();
else
replyAddressing = addressing.createReplyHeaders();
//
// DONE - must be sure to remove the request context, or
// we'll have a memory leak
//
env.removeAddressingContext();
//
// import all of the headers into the response envelope...
//
Element replyXML = replyAddressing.toXML();