Results 1 to 2 of 2

Thread: create a SOAPMessage with an dom Element

  1. #1

    Default 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. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    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);
    }
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •