module.exports = (params) => {
// create SOAP client with params
const soapClient = easysoap.createClient(params);
return {
request: function(json) {
// convert json to xml
soapClient.call(soapXML);
}
}
};
const params = {
"user": "John",
"password": "1234"
}
const clientBuilder = require('path/to/previous/code');
const client = clientBuilder(params)
client.request('')