if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
soap11 = false;
// it is SOAP 1.2
builder =
new StAXSOAPModelBuilder(xmlreader,
SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
envelope = (SOAPEnvelope) builder.getDocumentElement();
} else if (contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
soap11 = true;
/**
* Configuration via Deployment
*/
Parameter enable =
msgContext.getParameter(Constants.Configuration.ENABLE_REST);
if (((soapActionHeader == null) || (soapActionHeader.length() == 0))
&& (enable != null)) {
if (Constants.VALUE_TRUE.equals(enable.getValue())) {
// 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 !!
msgContext.setDoingREST(true);
SOAPFactory soapFactory = new SOAP11Factory();
builder = new StAXOMBuilder(xmlreader);
builder.setOmbuilderFactory(soapFactory);
envelope = soapFactory.getDefaultEnvelope();
envelope.getBody().addChild(builder.getDocumentElement());
}
} else {
builder = new StAXSOAPModelBuilder(
xmlreader, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
envelope = (SOAPEnvelope) builder.getDocumentElement();
}
}
}