APPCAN MAS接口中使用webservice接口形式,示例代码如下:
1 var MEAP=require("meap"); 2 3 function run(Param, Robot, Request, Response, IF) 4 { 5 var id = Param.params.id?Param.params.id:0; 6 var headers = '头信息'; 7 var option = { 8 wsdl: "wsdl接口地址", 9 func: "函数名称", 10 Params: { 11 参数:参数值 12 }, 13 soapHeader:headers 14 }; 15 16 MEAP.SOAP.Runner(option, function(err, res, data){ 17 if (!err) { 18 Response.end(JSON.stringify({ 19 status: "0", 20 message: 'success', 21 list: data 22 })); 23 } 24 else { 25 Response.end(JSON.stringify({ 26 status: '-1', 27 message: 'Error' 28 })); 29 } 30 }); 31 } 32 exports.Runner = run;