Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-1692

SOAPElement.importNode() not supported

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jbossws-2.0.0
    • None
    • jbossws-native
    • None
    • Medium

      If I have a SOAPMessage constructed using the MessageFactory interface, I should be able to import a node from a different document and append to the first child of soap body.

      This does not work correctly. I have tested this against the SAAJ RI and it works fine there.

      Here is sample code:
      MessageFactory factory = MessageFactory.newInstance();
      File soapreqfile = new File("soap-request-template.xml");
      SOAPMessage msg = factory.createMessage(null, new FileInputStream(soapreqfile));

      //Get the node that needs to be imported
      Node someNode = getNode("import-node.xml");

      //Import the node
      Node importedNode = msg.getSOAPPart().getOwnerDocument().importNode(someNode, true);
      //Append the node to the first child
      msg.getSOAPBody.getFirstChild().appendChild(importedNode);

              tdiesler@redhat.com Thomas Diesler
              anil.saldhana Anil Saldanha (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: