微信云函数调用webservice 接口,一直调用不通,请问有什么解决方案么,是基于http协议的。
// 云函数入口文件
const cloud = require(‘wx-server-sdk’)
const soap = require(‘soap’)
cloud.init()
// 云函数入口函数
exports.main = async (event, context) => {
var url = ‘http://113.204.182.146:13009/uapws/service/nc.itf.mydemo.IMyDemoINF?wsdl’;
var result=‘wu’;
var args=“123123123”;
soap.createClient(url, function (err, client) {
client.DemoITF(args, function (err, result) {
if (err) {
ctx.logger.info(“成功”);
console.log(“成功”);
this.date.result = result;
return “成功”;
} else {
ctx.logger.info(“失败”);
console.log(“失败”);
return “失败”;
}
});
});
return result;
}