Messaging { public static SOAPHeaderBlock createElement(final org.apache.axiom.soap.SOAPEnvelope env) { SOAPHeaderBlock messaging = getElement(env); if( messaging == null) { messaging = env.getHeader().addHeaderBlock(Q_ELEMENT_NAME.getLocalPart(), SOAPEnv.getEbms3Namespace(env)); messaging.setMustUnderstand(true); } return messaging; }  static SOAPHeaderBlock createElement(final org.apache.axiom.soap.SOAPEnvelope env); static SOAPHeaderBlock getElement(final SOAPEnvelope env); static final QName Q_ELEMENT_NAME; }
@Test public void testCreateElement() throws Exception { SOAPEnvelope env = SOAPEnv.createEnvelope(SOAPEnv.SOAPVersion.SOAP_12); Messaging.createElement(env); SOAPHeader header = env.getHeader(); ArrayList blocks = header.getHeaderBlocksWithNSURI(EbMSConstants.EBMS3_NS_URI); assertTrue(blocks.size()>0); assertTrue(((SOAPHeaderBlock) blocks.get(0)).getMustUnderstand()); }