org.apache.axis.MessageContext messageContext = new org.apache.axis.MessageContext(null);
req.setAttribute(MESSAGE_CONTEXT, messageContext);
messageContext.setClassLoader(classLoader);
Message responseMessage = null;
String contentType = req.getHeader(HTTPConstants.HEADER_CONTENT_TYPE);
String contentLocation = req.getHeader(HTTPConstants.HEADER_CONTENT_LOCATION);
InputStream inputStream = req.getInputStream();
Message requestMessage = new Message(inputStream, false, contentType, contentLocation);
messageContext.setRequestMessage(requestMessage);
messageContext.setProperty(HTTPConstants.MC_HTTP_SERVLETPATHINFO, req.getURI().getPath());
messageContext.setProperty(org.apache.axis.MessageContext.TRANS_URL, req.getURI().toString());
messageContext.setService(service);
messageContext.setProperty(REQUEST, req);
messageContext.setProperty(RESPONSE, res);
messageContext.setProperty(AxisEngine.PROP_DISABLE_PRETTY_XML, Boolean.TRUE);
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
try {
try {
String characterEncoding = (String) requestMessage.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
if (characterEncoding != null) {
messageContext.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, characterEncoding);
} else {
messageContext.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-8");
}
String soapAction = req.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
if (soapAction != null) {
messageContext.setUseSOAPAction(true);
messageContext.setSOAPActionURI(soapAction);
}
SOAPEnvelope env = requestMessage.getSOAPEnvelope();
if (env != null && env.getSOAPConstants() != null) {
messageContext.setSOAPConstants(env.getSOAPConstants());
}
SOAPService service = messageContext.getService();