requestURI));
msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
msgContext.setServerSide(true);
SOAPEnvelope envelope = null;
StAXBuilder builder = null;
if (contentType.indexOf(HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED) >= 0){
builder = selectBuilderForMIME(msgContext, in, contentType);
envelope = (SOAPEnvelope) builder.getDocumentElement();
} else if (contentType != null
&& contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
//If the content Type is text/xml (BTW which is the SOAP 1.1 Content type ) and
//the SOAP Action is absent it is rest !!
Object enable = msgContext.getProperty(Constants.Configuration.ENABLE_REST);
if ((soapAction == null || soapAction.length() == 0)
&& Constants.VALUE_TRUE.equals(enable)) {
msgContext.setDoingREST(true);
SOAPFactory soapFactory = new SOAP11Factory();
Reader reader = new InputStreamReader(in);
XMLStreamReader xmlreader = XMLInputFactory.newInstance()
.createXMLStreamReader(reader);
builder = new StAXOMBuilder(xmlreader);
builder.setOmbuilderFactory(soapFactory);
envelope = soapFactory.getDefaultEnvelope();
envelope.getBody().addChild(builder.getDocumentElement());
}
}
if (envelope == null) {
Reader reader = new InputStreamReader(in);
XMLStreamReader xmlreader = XMLInputFactory.newInstance()
.createXMLStreamReader(reader);
builder = new StAXSOAPModelBuilder(xmlreader);
envelope = (SOAPEnvelope) builder.getDocumentElement();
}
msgContext.setEnvelope(envelope);
AxisEngine engine = new AxisEngine(configurationContext);
engine.receive(msgContext);