【发布时间】:2015-04-30 01:51:39
【问题描述】:
我正在尝试使用带有 node-soap 的 SOAP api。我只是在运行一些本地主机测试。
这是我的 wsdl:http://hastebin.com/orenizosay.xml
这是我的 XSD(来自 WSDL):http://hastebin.com/zaqogicabo.xml
public class InsulinEndpoint {
public static void main(String[] argv) {
Insulin insulin = new Insulin ();
String address = "http://localhost:8081/insulin/";
Endpoint.publish(address, insulin);
System.out.println("Webservices online at: " + address);
}
}
这是我的节点测试应用。客户端创建成功,client.describe() 正确显示方法。
soap.createClient(url, function(err, client) {
if (err) throw err;
client.backgroundInsulinDose({arg0: 10}, function(err, result) {
if(err)
console.error(err);
else
console.log(result);
});
});
但是当我尝试调用 backgroundInsulinDose 时,我的反应是
<faultstring>Cannot find dispatch method for {}backgroundInsulinDose</faultstring>
node-soap 发送的我的 XML 消息是
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tns="http://server/"><soap:Body><backgroundInsulinDose><arg0>10</arg0></backgroundInsulinDose></soap:Body></soap:Envelope>--------------------
【问题讨论】: