gpt4 book ai didi

Node.js SOAP : invalid message definition for rpc style binding

转载 作者:搜寻专家 更新时间:2023-10-31 23:31:48 24 4
gpt4 key购买 nike

我正在尝试使用来自 Node 的 wsdl。使用“vpulim/node-soap”。

我可以加载 wsdl、描述它,甚至调用某些函数。但是,每当我尝试调用一个不需要任何参数的函数时,我都会收到错误消息:

assert.js:92
throw new assert.AssertionError({
^
AssertionError: invalid message definition for rpc style binding
at Client._invoke (/home/user/node_scripts/application/node_modules/soap/lib/client.js:126:12)
at null.getManagedModules (/home/user/node_scripts/application/node_modules/soap/lib/client.js:87:10)
at /home/user/node_scripts/application/client.js:9:12
at /home/user/node_scripts/application/node_modules/soap/lib/soap.js:48:5
at null.callback (/home/user/node_scripts/application/node_modules/soap/lib/soap.js:35:7)
at /home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:716:12
at WSDL._processNextInclude (/home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:732:12)
at WSDL.processIncludes (/home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:762:8)
at /home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:678:10
at process._tickCallback (node.js:415:13)

这是描述():

{ AlertPollingService:
{ AlertPollingService:
{ getManagementModule: [Object],
getEMConfig: [Object],
getAlertSnapshot: [Object],
getAlertSnapshots: [Object],
getManagedModules: [Object],
getAllIscopeManagmentModules: [Object],
getAllFilteredIscopeManagmentModules: [Object],
getAllAlertsSnapshot: [Object],
getAllAlertsSnapshotForManagementModule: [Object],
getAgentSnapshot: [Object],
getAgentSnapshots: [Object] } } }

如果我运行以下代码,它工作正常。我还将包含来自 SoapUI 的 soap 请求:

var args = {manModuleName: 'MQ'}
soap.createClient(url, function(err, client) {
console.log(client.describe());
client.getManagementModule(args, function(err, result) {
console.log(result);
});
});

### SOAPUI REQUEST ###
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aler="http://alerts.hidden.server.hidden.com">
<soapenv:Header/>
<soapenv:Body>
<aler:getManagementModule soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<manModuleName xsi:type="xsd:string">MQ</manModuleName>
</aler:getManagementModule>
</soapenv:Body>
</soapenv:Envelope>

所以该函数工作正常,因为我能够传递一个 arg。但是,以下代码因上述错误而失败。您可以从 soapui 请求中看到没有期望的参数。它只是一个返回列表的函数调用。我试过设置空白参数、空参数等...无法让它工作。

soap.createClient(url, function(err, client) {
console.log(client.describe());
client.getManagedModules(function(err, result) {
console.log(result);
});
});

### SOAPUI REQUEST ###
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aler="http://alerts.hidden.server.hidden.com">
<soapenv:Header/>
<soapenv:Body>
<aler:getManagedModules soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</soapenv:Body>
</soapenv:Envelope>

关于如何让它发挥作用的任何想法?

最佳答案

我为此苦恼了一段时间 - 我成功地将 args 定义为“null”:

soap.createClient(url, function(err, client) {
console.log(client.describe());
client.getManagedModules(null, function(err, result) {
console.log(result);
});
});

关于Node.js SOAP : invalid message definition for rpc style binding,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22021944/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com