Announcement Announcement Module
Collapse
No announcement yet.
create a SOAPMessage with an dom Element Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • create a SOAPMessage with an dom Element

    i have a AbstractDomPayloadEndpoint with:
    Element invokeInternal(Element requestElement, Document doc)

    this web service have to call another with the same body (requestElement). i have create a SOAPMessage (saaj), but i don't find a method to add an Element.
    how can do it???

    thanks in advance,
    CÚsar.

  • #2
    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);
    }

    Comment

    Working...
    X