22 lines
562 B
JavaScript
22 lines
562 B
JavaScript
const soap = require('soap');
|
|
|
|
module.exports = {
|
|
async wsdl(methodName, args) {
|
|
try {
|
|
const wsdlUrl = "http://ye4s.com/webservice/ws?wsdl";
|
|
const obj = {};
|
|
args.forEach((value, index) => {
|
|
obj['arg' + index] = value;
|
|
});
|
|
const client = await soap.createClientAsync(wsdlUrl);
|
|
const result = await client[methodName + 'Async'](obj);
|
|
return result[0];
|
|
} catch (error) {
|
|
console.error('Error calling SOAP service:', error);
|
|
throw error;
|
|
}
|
|
},
|
|
async checkRule(path,module){
|
|
|
|
}
|
|
}; |