RoutingInput { public static OMElement createElement(final SOAPEnvelope soapEnv, final IUserMessage routinginfo) { final OMFactory f = soapEnv.getOMFactory(); final OMElement routingInput = f.createOMElement(Q_ELEMENT_NAME); routingInput.declareNamespace(EbMSConstants.EBMS3_NS_URI, EbMSConstants.EBMS3_NS_PREFIX); final OMElement usrMsgElem = UserMessageElement.createElement(routingInput, routinginfo); usrMsgElem.setNamespace(routingInput.getNamespace()); return routingInput; }  static OMElement createElement(final SOAPEnvelope soapEnv, final IUserMessage routinginfo); static final QName Q_ELEMENT_NAME; }
@Test public void testFullUserMessageHeader() { UserMessage userMessage = new UserMessage(); userMessage.setMessageId(UUID.randomUUID().toString()); userMessage.setTimestamp(new Date()); TradingPartner sender = new TradingPartner(); sender.addPartyId(new PartyId("TheSender", null)); sender.setRole("Sender"); userMessage.setSender(sender); TradingPartner receiver = new TradingPartner(); receiver.addPartyId(new PartyId("TheRecipient", null)); receiver.setRole("Receiver"); userMessage.setReceiver(receiver); CollaborationInfo collabInfo = new CollaborationInfo(); collabInfo.setService(new Service("MultiHopTest")); collabInfo.setAction("CreateRoutingInput"); userMessage.setCollaborationInfo(collabInfo); final SOAPEnvelope env = SOAPEnv.createEnvelope(SOAPEnv.SOAPVersion.SOAP_12); final OMElement ri = RoutingInput.createElement(env, userMessage); assertEquals(MultiHopConstants.ROUTING_INPUT_NS_URI, ri.getNamespaceURI()); final Iterator<?> umChilds = ri.getChildrenWithLocalName("UserMessage"); assertTrue(umChilds.hasNext()); final OMElement umChild = (OMElement) umChilds.next(); assertEquals(MultiHopConstants.ROUTING_INPUT_NS_URI, umChild.getNamespaceURI()); final Iterator<?> ciChilds = umChild.getChildrenWithLocalName("CollaborationInfo"); assertTrue(ciChilds.hasNext()); final OMElement ciChild = (OMElement) ciChilds.next(); assertEquals(EbMSConstants.EBMS3_NS_URI, ciChild.getNamespaceURI()); }