use of org.apache.axiom.soap.SOAPMessage in project webservices-axiom by apache.
the class TestGetCharsetEncodingWithParser method runTest.
@Override
protected void runTest() throws Throwable {
String encoding = "iso-8859-15";
SOAPEnvelope orgEnvelope = soapFactory.getDefaultEnvelope();
soapFactory.createOMElement("echo", soapFactory.createOMNamespace("urn:test", null)).setText("test");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OMOutputFormat format = new OMOutputFormat();
format.setCharSetEncoding(encoding);
orgEnvelope.serialize(baos, format);
SOAPMessage message = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, new ByteArrayInputStream(baos.toByteArray()), encoding).getSOAPMessage();
assertEquals(encoding, message.getCharsetEncoding());
}
use of org.apache.axiom.soap.SOAPMessage in project webservices-axiom by apache.
the class TestSetOMDocumentElement method runTest.
@Override
protected void runTest() throws Throwable {
SOAPMessage message = soapFactory.createSOAPMessage();
OMElement envelope = soapFactory.getDefaultEnvelope();
message.setOMDocumentElement(envelope);
assertSame(envelope, message.getFirstOMChild());
}
use of org.apache.axiom.soap.SOAPMessage in project webservices-axiom by apache.
the class TestSetOMDocumentElementNonSOAPEnvelope method runTest.
@Override
protected void runTest() throws Throwable {
SOAPMessage message = soapFactory.createSOAPMessage();
OMElement element = soapFactory.createOMElement(new QName("test"));
try {
message.setOMDocumentElement(element);
fail("Expected OMException");
} catch (OMException ex) {
// Expected
}
}
use of org.apache.axiom.soap.SOAPMessage in project webservices-axiom by apache.
the class TestCreateSOAPModelBuilderFromDOMSource method runTest.
@Override
protected void runTest() throws Throwable {
Document document = DOMImplementation.XERCES.parse(new InputSource(SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getUrl().toString()));
SOAPMessage message = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, new DOMSource(document)).getSOAPMessage();
assertAbout(xml()).that(xml(OMDocument.class, message)).ignoringWhitespaceInPrologAndEpilog().hasSameContentAs(document);
assertThat(message.getSOAPEnvelope().getBody().getFault()).isNotNull();
}
use of org.apache.axiom.soap.SOAPMessage in project webservices-axiom by apache.
the class SOAPFactoryImpl method createDefaultSOAPMessage.
@Override
public final SOAPMessage createDefaultSOAPMessage() {
SOAPMessage message = createSOAPMessage();
SOAPEnvelope env = createSOAPEnvelope();
message.addChild(env);
createSOAPBody(env);
return message;
}
Aggregations