【发布时间】:2017-06-20 19:48:11
【问题描述】:
这是我的代码,除了 call soap 方法外,一切都正常 返回错误,请帮助:)
"use strict";
var easysoap = require('easysoap');
// define soap params
var params = {
host: 'www.privateqa.invoice4u.co.il',
path: '/Services/MeshulamService.svc',
wsdl: '/Services/MeshulamService.svc?singleWsdl',
}
/*
* create the client
*/"
var soapClient = easysoap.createClient(params);
/* * get all available functions */
soapClient.getAllFunctions()
.then((functionArray) => { console.log(functionArray); })
.catch((err) => { throw new Error(err); });
/* * get the method params by given methodName */
soapClient.getMethodParamsByName('ProccessRequest')
.then((methodParams) => {
console.log(JSON.stringify(methodParams.request));
// console.log(JSON.stringify(methodParams.response));
return methodParams;
})
.catch((err) => {
console.log(err); });
/* * 调用soap方法 */
soapClient.call({
method : 'ProccessRequest',
attributes: {
xmlns: "https://privateqa.invoice4u.co.il/"
},
params: {
'UserEmail' : 'test@test.com',
'UserPassword': '123456',
'FullName': 'idan tabachnik',
'Phone': '0525410849',
'Sum': 10.00,
'PaymentsNum': 1,
'Type': 1,
'ReturnUrl': 'mako.co.il'
}
}).then((callResponse) => {
debugger;
console.log(callResponse.data); // response data as json
// console.log(callResponse.body); // response body
// console.log(callResponse.header); //response header
}).catch((err) => { throw new Error(err); });
我收到“UnhandledPromiseRejectionWarning: Unhandled Promise Rejection”的错误
【问题讨论】:
标签: javascript node.js web-services soap