use of org.apache.axiom.soap.SOAPHeader in project webservices-axiom by apache.
the class TestGetOrCreateHeader method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
SOAPHeader header = (SOAPHeader) envelope.getFirstOMChild();
assertSame(header, envelope.getOrCreateHeader());
}
use of org.apache.axiom.soap.SOAPHeader in project webservices-axiom by apache.
the class TestAddHeaderBlockWithoutNamespace1 method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
SOAPHeader header = soapFactory.createSOAPHeader(envelope);
try {
header.addHeaderBlock("test", null);
fail("Expected OMException");
} catch (OMException ex) {
// Expected
}
}
use of org.apache.axiom.soap.SOAPHeader in project webservices-axiom by apache.
the class TestAddHeaderToIncompleteEnvelope method runTest.
@Override
protected void runTest(SOAPEnvelope envelope) throws Throwable {
assertNull(envelope.getHeader());
SOAPHeader header = soapFactory.createSOAPHeader(envelope);
assertSame(header, envelope.getHeader());
}
use of org.apache.axiom.soap.SOAPHeader in project webservices-axiom by apache.
the class TestGetBooleanAttributeUnspported method runTest.
@Override
protected void runTest() throws Throwable {
SOAPHeader header = soapFactory.getDefaultEnvelope().getOrCreateHeader();
SOAPHeaderBlock headerBlock = header.addHeaderBlock(new QName("urn:test", "test", "p"));
try {
attribute.getAdapter(BooleanAttributeAccessor.class).getValue(headerBlock);
fail("Expected UnsupportedOperationException");
} catch (UnsupportedOperationException ex) {
// Expected
}
}
use of org.apache.axiom.soap.SOAPHeader in project webservices-axiom by apache.
the class TestAddHeaderBlockWithoutNamespace2 method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
SOAPHeader header = soapFactory.createSOAPHeader(envelope);
OMNamespace ns = soapFactory.createOMNamespace("", "");
try {
header.addHeaderBlock("test", ns);
fail("Expected OMException");
} catch (OMException ex) {
// Expected
}
}
Aggregations