Axis
  1. Axis
  2. AXIS-2705

SOAPFaultBuilder throws DOMException WRONG_DOCUMENT_ERR

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.4.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP SP2 + NetBeans 5.5 + JDK1.5 + Axis 1.4

      Description

      This issue had been patched for Axis 1.3 but not for Axis 1.4.
      I'm developping a Java client from the wsdl contract of a PHP NuSoap doc/lit webservice with Axis 1.4.

      I success to generate my Java client with Axis 1.4 but when my client call a method of the stub linked to my webservice and generated by Axis :

      AxisFault
      faultCode:

      {http://schemas.xmlsoap.org/soap/envelope/}

      Server.userException
      faultSubcode:
      faultString: org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
      faultActor:
      faultNode:
      faultDetail:

      {http://xml.apache.org/axis/}

      stackTrace:org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
      at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source)
      at org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source)
      at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
      at org.apache.axis.message.SOAPFaultBuilder.onEndChild(SOAPFaultBuilder.java:305)
      at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1090)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
      at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
      at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
      at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
      at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
      at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      at org.apache.axis.client.Call.invoke(Call.java:2767)
      at org.apache.axis.client.Call.invoke(Call.java:2443)
      at org.apache.axis.client.Call.invoke(Call.java:2366)
      at org.apache.axis.client.Call.invoke(Call.java:1812)
      at sympaserver.cgi_bin.sympa.wwsympa_fcgi.wsdl.SOAPStub.login(SOAPStub.java:789)
      at sympaserver.cgi_bin.sympa.wwsympa_fcgi.wsdl.SympaServiceClient.main(SympaServiceClient.java:31)

      {http://xml.apache.org/axis/}

      hostname:DIPLODOCUS

      org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
      at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
      at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
      at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
      at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
      at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      at org.apache.axis.client.Call.invoke(Call.java:2767)
      at org.apache.axis.client.Call.invoke(Call.java:2443)
      at org.apache.axis.client.Call.invoke(Call.java:2366)
      at org.apache.axis.client.Call.invoke(Call.java:1812)
      at sympaserver.cgi_bin.sympa.wwsympa_fcgi.wsdl.SOAPStub.login(SOAPStub.java:789)
      at sympaserver.cgi_bin.sympa.wwsympa_fcgi.wsdl.SympaServiceClient.main(SympaServiceClient.java:31)
      Caused by: org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
      at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source)
      at org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source)
      at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
      at org.apache.axis.message.SOAPFaultBuilder.onEndChild(SOAPFaultBuilder.java:305)
      at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1090)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
      at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
      ... 10 more

        Issue Links

          Activity

          Hide
          Rudy Moury added a comment -

          This issue had been solved for Axis1.3 but not patched for Axis 1.4.

          Show
          Rudy Moury added a comment - This issue had been solved for Axis1.3 but not patched for Axis 1.4.
          Hide
          Yariv Tzaban added a comment -

          Is there a plan to fix this in Axis 1.4?

          Show
          Yariv Tzaban added a comment - Is there a plan to fix this in Axis 1.4?
          Hide
          adri added a comment -

          I've patched SOAPFaultBuilder and solved the problem:

          } else if(node instanceof Text)

          { elements[i] = XMLUtils.newDocument().createElement("text"); Node node2 = elements[i].getOwnerDocument().importNode(node, true); // line added elements[i].appendChild(node2); }

          In that way, node2 is a new node of "element[i] 's Document imported from node.

          diff -u :

          — axis-1_4/src/org/apache/axis/message/SOAPFaultBuilder.java 2009-02-13 17:00:01.000000000 +0100
          +++ axis-1_4_orig/src/org/apache/axis/message/SOAPFaultBuilder.java 2006-04-23 03:57:27.000000000 +0200
          @@ -302,8 +302,7 @@
          elements[i] = ((MessageElement) node).getAsDOM();
          } else if(node instanceof Text)

          { elements[i] = XMLUtils.newDocument().createElement("text"); - Node node2 = elements[i].getOwnerDocument().importNode(node, true); - elements[i].appendChild(node2); + elements[i].appendChild(node); }

          } catch (Exception e) {
          throw new SAXException(e);

          Show
          adri added a comment - I've patched SOAPFaultBuilder and solved the problem: } else if(node instanceof Text) { elements[i] = XMLUtils.newDocument().createElement("text"); Node node2 = elements[i].getOwnerDocument().importNode(node, true); // line added elements[i].appendChild(node2); } In that way, node2 is a new node of "element [i] 's Document imported from node. diff -u : — axis-1_4/src/org/apache/axis/message/SOAPFaultBuilder.java 2009-02-13 17:00:01.000000000 +0100 +++ axis-1_4_orig/src/org/apache/axis/message/SOAPFaultBuilder.java 2006-04-23 03:57:27.000000000 +0200 @@ -302,8 +302,7 @@ elements [i] = ((MessageElement) node).getAsDOM(); } else if(node instanceof Text) { elements[i] = XMLUtils.newDocument().createElement("text"); - Node node2 = elements[i].getOwnerDocument().importNode(node, true); - elements[i].appendChild(node2); + elements[i].appendChild(node); } } catch (Exception e) { throw new SAXException(e);
          Hide
          Ladislav Lencucha added a comment - - edited

          Many thanks adri!

          Everybody else - I have not been able to get 1.4 jar with this fix so I compiled it by myself. If you're as lazy as I am you get from my website.

          Version 1.4 Compiled with patch from adri and available at:
          http://www.lacike.sk/?p=53

          or just use direct download link of the zip file:
          http://www.lacike.sk/wp-content/uploads/2010/10/axis_1.4_fix.zip

          Enjoy!

          Show
          Ladislav Lencucha added a comment - - edited Many thanks adri! Everybody else - I have not been able to get 1.4 jar with this fix so I compiled it by myself. If you're as lazy as I am you get from my website. Version 1.4 Compiled with patch from adri and available at: http://www.lacike.sk/?p=53 or just use direct download link of the zip file: http://www.lacike.sk/wp-content/uploads/2010/10/axis_1.4_fix.zip Enjoy!
          Hide
          danskal added a comment -

          I don't understand why this is unresolved. There is a fix for a major bug several years old, but no fix in the maven repositories? Is there something I am missing?

          Show
          danskal added a comment - I don't understand why this is unresolved. There is a fix for a major bug several years old, but no fix in the maven repositories? Is there something I am missing?
          Hide
          Hudson added a comment -

          Integrated in axis-trunk #71 (See https://builds.apache.org/job/axis-trunk/71/)
          Designed a test case for AXIS-2705.

          veithen :
          Files :

          • /axis/axis1/java/trunk/axis/src/test/java/test/message/TestSOAPFault.java
          • /axis/axis1/java/trunk/axis/src/test/resources/test/message/AXIS-2705.xml
          Show
          Hudson added a comment - Integrated in axis-trunk #71 (See https://builds.apache.org/job/axis-trunk/71/ ) Designed a test case for AXIS-2705 . veithen : Files : /axis/axis1/java/trunk/axis/src/test/java/test/message/TestSOAPFault.java /axis/axis1/java/trunk/axis/src/test/resources/test/message/ AXIS-2705 .xml
          Hide
          Hudson added a comment -

          Integrated in axis-trunk #72 (See https://builds.apache.org/job/axis-trunk/72/)
          AXIS-2705: Reintegrated r392364 (fix for AXIS-2394) into the trunk.

          veithen :
          Files :

          • /axis/axis1/java/trunk/axis/src/main/java
          • /axis/axis1/java/trunk/axis/src/main/java/org/apache/axis/message/SOAPFaultBuilder.java
          Show
          Hudson added a comment - Integrated in axis-trunk #72 (See https://builds.apache.org/job/axis-trunk/72/ ) AXIS-2705 : Reintegrated r392364 (fix for AXIS-2394 ) into the trunk. veithen : Files : /axis/axis1/java/trunk/axis/src/main/java /axis/axis1/java/trunk/axis/src/main/java/org/apache/axis/message/SOAPFaultBuilder.java
          Hide
          Hudson added a comment -

          Integrated in axis-trunk #73 (See https://builds.apache.org/job/axis-trunk/73/)
          Final test case for AXIS-2705.

          veithen :
          Files :

          • /axis/axis1/java/trunk/axis/src/test/java/test/message/TestSOAPFault.java
          Show
          Hudson added a comment - Integrated in axis-trunk #73 (See https://builds.apache.org/job/axis-trunk/73/ ) Final test case for AXIS-2705 . veithen : Files : /axis/axis1/java/trunk/axis/src/test/java/test/message/TestSOAPFault.java

            People

            • Assignee:
              Andreas Veithen
              Reporter:
              Rudy Moury
            • Votes:
              8 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development