【问题标题】:Unable to send parameters to SOAP method from Meteor's HTTP method无法从 Meteor 的 HTTP 方法向 SOAP 方法发送参数
【发布时间】:2015-03-27 16:02:12
【问题描述】:
我正在使用流星的http 包连接到通过 SOAP 消息进行通信的服务器。以下是代码(没有原始 url、命名空间、方法名和参数):
HTTP.call('POST', 'http://soap-service-url.com', {
身份验证:'用户:密码',
标题:{
SOAPTarget: 'http://soap-service-url.com',
SOAPAction: 'http://required-namespace.com/methodName',
“内容类型”:“文本/xml”
},
参数:{
参数1:“参数值”,
参数2:'
',
},
内容:'' +
'' +
'' +
' ' +
'参数值' +
']]>' +
' ' +
' ' +
'信封>'
},函数(错误,结果){
如果(错误){
console.log('发生错误..');
控制台日志(错误);
返回;
}
控制台.log(结果);
console.log('----------');
});
当我调用不带参数的方法时,我可以获得预期的输出。但是当我用参数调用方法时,我得到了意想不到的输出。由于 content 属性中给出的参数没有传递,我添加了 params 属性,即使这样我也无法接收到预期的输出。为了测试这个问题,我创建了一个节点 js 应用程序并使用node-soap 模块连接到同一台服务器。我可以通过client.myMethod(args, callback[, options]) 上的args 传递参数并获得预期的结果。使用meteor的http包时如何传递参数?
【问题讨论】:
标签:
http
soap
meteor