use of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder in project wso2-axis2-transports by wso2.
the class AbstractTransportTest method assertSOAPEchoResponse.
protected void assertSOAPEchoResponse(String textValue, XMLStreamReader reader) {
SOAPEnvelope env = new StAXSOAPModelBuilder(reader).getSOAPEnvelope();
assertEchoResponse(textValue, env.getBody().getFirstElement());
}
use of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder in project wso2-axis2-transports by wso2.
the class BaseUtils method getEnvelope.
/**
* Create a SOAP envelope using SOAP 1.1 or 1.2 depending on the namespace
* @param in InputStream for the payload
* @param namespace the SOAP namespace
* @return the SOAP envelope for the correct version
* @throws javax.xml.stream.XMLStreamException on error
*/
public static SOAPEnvelope getEnvelope(InputStream in, String namespace) throws XMLStreamException {
try {
in.reset();
} catch (IOException ignore) {
}
XMLStreamReader xmlreader = StAXUtils.createXMLStreamReader(in, MessageContext.DEFAULT_CHAR_SET_ENCODING);
StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader, namespace);
return (SOAPEnvelope) builder.getDocumentElement();
}
Aggregations