private MessageAbstraction processRequest(Endpoint ep, MimeHeaderSource headerSource, InvocationContext reqContext, InputStream inputStream)
throws BindingException
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
long beginProcessing = 0;
ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
try
{
EndpointState state = ep.getState();
if (state != EndpointState.STARTED)
{
QName faultCode = Constants.SOAP11_FAULT_CODE_SERVER;
String faultString = "Endpoint cannot handle requests in state: " + state;
throw new CommonSOAPFaultException(faultCode, faultString);
}
log.debug("BEGIN handleRequest: " + ep.getName());
beginProcessing = initRequestMetrics(ep);
MimeHeaders headers = (headerSource != null ? headerSource.getMimeHeaders() : null);
MessageAbstraction reqMessage;
String bindingID = sepMetaData.getBindingId();
if (HTTPBinding.HTTP_BINDING.equals(bindingID))
{
reqMessage = new HTTPMessageImpl(headers, inputStream);
}
else
{
msgFactory.setServiceMode(sepMetaData.getServiceMode());
msgFactory.setStyle(sepMetaData.getStyle());
reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers, inputStream);
}
// Associate current message with message context
msgContext.setMessageAbstraction(reqMessage);
// debug the incomming message
MessageTrace.traceMessage("Incoming Request Message", reqMessage);
// Set the thread context class loader
ClassLoader classLoader = sepMetaData.getClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);
// Get the Invoker
ServiceEndpointInvoker epInvoker = ep.getAttachment(ServiceEndpointInvoker.class);
if (epInvoker == null)