use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.
the class TestSerialize method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope soapEnvelope = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, message.getInputStream(), null).getSOAPEnvelope();
expansionStrategy.apply(soapEnvelope);
assertAbout(xml()).that(serializationStrategy.serialize(soapEnvelope).getInputSource()).ignoringRedundantNamespaceDeclarations().ignoringPrologAndEpilog().hasSameContentAs(message.getInputStream());
soapEnvelope.close(false);
}
use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.
the class TestSerializeAndConsumeWithOMSEInBody method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
SOAPBody body = soapFactory.createSOAPBody();
envelope.addChild(body);
OMNamespace ns = soapFactory.createOMNamespace("http://ns1", "d");
OMElement payload = soapFactory.createOMElement(new DummySource(), "dummy", ns);
// This line will cause NoSuchElementException
payload.setNamespace(ns);
body.addChild(payload);
StringWriter writer = new StringWriter();
envelope.serializeAndConsume(writer);
// System.out.println(writer);
}
use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.
the class TestHasFaultWithOMSEUnknownName method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
SOAPBody body = envelope.getBody();
OMSourcedElement element = soapFactory.createOMElement(new StringOMDataSource("<ns:root xmlns:ns='urn:ns'/>"));
body.addChild(element);
assertFalse(body.hasFault());
assertFalse(element.isExpanded());
}
use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.
the class BadInputTest method runTest.
@Override
protected void runTest() throws Throwable {
try {
SOAPEnvelope soapEnvelope = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, BadInputTest.class.getClassLoader().getResourceAsStream("badsoap/" + file), null).getSOAPEnvelope();
OMTestUtils.walkThrough(soapEnvelope);
fail("this must failed gracefully with SOAPProcessingException");
} catch (SOAPProcessingException e) {
return;
}
}
use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.
the class MessageTest method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope soapEnvelope = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, message.getInputStream(), null).getSOAPEnvelope();
OMTestUtils.walkThrough(soapEnvelope);
soapEnvelope.close(false);
}
Aggregations