Java DOM异常错误\u文档\u错误:向Adobe Indesign发送soap请求时
我有Xubuntu 16.04作为主机,我在VirtualBox上运行Windows7。在Windows机器上,我有开发者版的Adobe InDesign 2014服务器。我使用生成的文件(InDesign WSDL的java类)和Axis 1.4调用一个简单的测试脚本,但是我得到了以下错误Java DOM异常错误\u文档\u错误:向Adobe Indesign发送soap请求时,java,soap,virtualbox,axis,adobe-indesign,Java,Soap,Virtualbox,Axis,Adobe Indesign,我有Xubuntu 16.04作为主机,我在VirtualBox上运行Windows7。在Windows机器上,我有开发者版的Adobe InDesign 2014服务器。我使用生成的文件(InDesign WSDL的java类)和Axis 1.4调用一个简单的测试脚本,但是我得到了以下错误 Caused by: org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than th
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.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 localhost.Service_wsdl.ServiceStub.runScript(ServiceStub.java:305)
在更深层次的调试中,我还发现一个错误AxisFault错误代码:Server.userException。整个情况都很奇怪,因为在我使用Xubuntu 14.04之前,我猜是VBox的早期版本,但一切都很顺利。我已经坚持了两个月了。我看不出以前的系统和我现在的系统有什么区别
我们有一个简单的测试来查看IDS是否正在运行和工作。我们使用以下JavaScript代码从Java调用Ping测试:
var scriptName = "BmpPing";
var scriptSource = app.scriptArgs.getValue('test');
app.consoleout('---------------------------');
app.consoleout(scriptName + " invoked: " + scriptSource);
var bmp = new File (app.activeScript.parent.fsName + '/bmp.jsx');
$.evalFile(bmp);
bmp_timediff.setStartTime();
bmp_log.debug(scriptName + " started on \"" + scriptSource + "\"...");
result = bmp_json.stringify({"PING": "PONG"});
bmp_log.info("BmpPing finished with result: '" + result + "' in: " +
(bmp_timediff.getDiff() / 1000) + " bmp seconds");
bmp_log.debug('============================');
result;
游平的脚本并不是那么简单,有很多地方可能会出错。首先尝试验证InDesign服务器是否正常工作 尝试以下js脚本:
main();
function main() {
return ("success");
// or return 1;
}
soap请求应该是这样的:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://ns.adobe.com/InDesign/soap/"><soapenv:Body>
<soap:RunScript>
<runScriptParameters>
<scriptLanguage>javascript</scriptLanguage>
<scriptFile>C:/InDesign/test.jsx</scriptFile>
</runScriptParameters>
</soap:RunScript>
</soapenv:Body>
</soapenv:Envelope>
javascript
C:/InDesign/test.jsx
答复如下:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:IDSP="http://ns.adobe.com/InDesign/soap/">
<SOAP-ENV:Body>
<IDSP:RunScriptResponse>
<errorNumber>0</errorNumber>
<scriptResult>
<data xsi:type="xsd:string">success</data>
</scriptResult>
</IDSP:RunScriptResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
0
成功
若你们并没有,你们需要看看你们的服务器的设置。如果你有它-开始添加脚本行一次一个,看看哪一个抛出异常
另外,尝试从不同的ui(如SOAPUI或Postman)进行soap调用只是为了开始-您运行的是InDesign Server而不是InDesign client,对吗?尝试调用一个非常简单的InDesign脚本,该脚本不做任何操作,也不引用DOM或任何文档,只需返回1到soap callI更新的帖子,并插入测试js。我不确定它是否符合你刚才所说的要求@尼科莱坎特