首页 新闻 会员 周边 捐助

调用web Service时报这个错,高手们指点一下

0
悬赏园豆:100 [已关闭问题] 关闭于 2013-01-30 15:14

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 javax.xml.parsers.SAXParser.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 fe.crm.Test.test2(Test.java:63)  at fe.crm.Test.main(Test.java:41)

 {http://xml.apache.org/axis/}hostname:jackieKang-PC

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 fe.crm.Test.test2(Test.java:63)  at fe.crm.Test.main(Test.java:41) 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 javax.xml.parsers.SAXParser.parse(Unknown Source)  at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)  at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)  ... 10 more

问题补充:

 public static void test2() {
  try {
   String queryXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
     + "<Interface type=\"query\" model=\"object\" value=\"Account\">\n"
     + "<Condition>\n"
     + "<Express field=\"Account.ID\" operator=\"LIKE\" value=\"\"/>\n"
     + "</Condition>\n</Interface>";
   String u8SerRrl = "http://localhost:8087/webservice/service.php?orgcode=crm&class=WS_EAI";
   String nameSpace = "http://localhost:8087/";
   String method = "process";
   Service servObj = new Service();
   Call callObj = (Call) servObj.createCall();
   callObj.setTargetEndpointAddress(new java.net.URL(u8SerRrl));
   callObj.setOperationName(new QName(nameSpace, method));
   callObj.addParameter(new QName(nameSpace, "queryXml"),
     org.apache.axis.Constants.XSD_STRING, ParameterMode.IN);
   callObj.setReturnType(org.apache.axis.Constants.XSD_STRING);
   callObj.setUseSOAPAction(true);
   callObj.setSOAPActionURI(nameSpace + method);
   callObj.invoke(new Object[] { queryXML });
  } catch (Exception e) {
   e.printStackTrace();
  }
 }

小-_-戴的主页 小-_-戴 | 初学一级 | 园豆:9
提问于:2012-06-04 16:10
< >
分享
所有回答(2)
0

A node is used in a different document than the one that created it

http://netbeans.org/bugzilla/show_bug.cgi?id=151430

看代码也没看出啥问题,不太懂java。

参考以下文章,看看能否找到答案;

http://www.w3.org/TR/2004/WD-SVG12-20040510/svgudom.html

http://hi.baidu.com/lb8585/blog/item/40fa2a22cdcc264493580735.html

http://topic.csdn.net/t/20050818/08/4215441.html

http://stackoverflow.com/questions/3184268/org-w3c-dom-domexception-wrong-document-err-a-node-is-used-in-a-different-docu

winzheng | 园豆:8797 (大侠五级) | 2012-06-05 07:22
0

  自己解决.

小-_-戴 | 园豆:9 (初学一级) | 2013-01-30 15:12
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册