1.0.0 • Published 9 years ago
code42day-foam v1.0.0
code42day-foam
Fork of the foam library without native dependency. It is using superagent for requests and xml2js for XML stringifying and parsing.
Usage
npm install code42day-foam --savevar operation = 'CelsiusToFahrenheit'
, namespace = 'http://www.w3schools.com/webservices/'
, action = "http://www.w3schools.com/webservices/CelsiusToFahrenheit"
, message = {'Celsius': '23'}
, uri = namespace + 'tempconvert.asmx'
;
var foam = require('code42day-foam');
foam(uri, operation, action, message, {namespace: namespace},
function (err, result) {
console.log(result.CelsiusToFahrenheitResponse.CelsiusToFahrenheitResult);
}
);Parameters
uri- endpoint of the SOAP serviceoperation- SOAP operationaction-Soapactionhttp headermessage- a Javascript object that will be serialised to XMLoptions- an options object
Options
header- optional SOAP headernamespace- optional xmlns namespace for theoperationnamespaces- optional additional namespaces for theEnvelopeelementbenchmark- set to true to log the request timing to the console, defaults false