try {
OMXMLParserWrapper omBuilder = OMTestUtils.getOMBuilder(
getTestResourceFile("soap/soapmessage.xml"));
SOAPEnvelope soapEnvelope = (SOAPEnvelope) omBuilder.getDocumentElement();
SOAPHeader soapHeader = soapEnvelope.getHeader();
SOAPHeaderBlock soapHeaderBlock = omFactory.createSOAPHeaderBlock(
"soapHeaderBlockOne", namespace, soapHeader);
assertTrue(
"Programatically created SOAPHeaderBlock should have done = true ",
soapHeaderBlock.isComplete());
SOAPHeaderBlock soapHeaderBlockTwo = omFactory.createSOAPHeaderBlock(
"soapHeaderBlockOne", namespace, soapHeader, omBuilder);
assertTrue(
"SOAPHeaderBlock with a builder should start with done = false ",
!soapHeaderBlockTwo.isComplete());
assertTrue("This SOAPHeaderBlock must have a builder ",
soapHeaderBlockTwo.getBuilder() instanceof OMXMLParserWrapper);
} catch (Exception e) {
log.info(e.getMessage());
}