I need to read the soap header from the incoming soap messages but i can't
i'm using the AbstractJDomPayloadEndpoint and can't find any information to get this information. I've found an AbstractDomPayloadEndpoint post on spring forums but raises "type errors" on Eclipse
The header i'm trying to read is called "ID"
this is my non-working code
and this is de post i referCode:protected String getID(Element rootElement){ String id = ""; try { javax.xml.soap.SOAPMessage message = MessageFactory.newInstance().createMessage(); SOAPPart sp = message.getSOAPPart(); Node imported = sp.importNode((Node)rootElement, true); javax.xml.soap.SOAPBody sb; sb = message.getSOAPBody(); sb.appendChild((Node)imported); id = message.getSOAPHeader().getFirstChild().getTextContent(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return id; }
have any body information about this?Code:Arjen Poutsma Arjen Poutsma is offline Senior Member Spring Team Join Date: Jul 2005 Location: Rotterdam, the Netherlands Posts: 1,490 Default Most SAAJ classes are actually subclasses of org.w3c.dom. For instance SOAPPart is a Document. So you could just do something like: Code: public Element invokeInternal(Element requestElement, Document doc) { SOAPMessage message = MessageFactory.newInstance().createMessage(); SOAPPart sp = message.getSOAPPart(); Element imported sp.importNode(requestElement, true); SOAPBody sb = message.getSOAPBody(); sb.appendChild(imported); }


Reply With Quote
