Skip to content

Instantly share code, notes, and snippets.

@joewils
Created December 2, 2013 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joewils/7755181 to your computer and use it in GitHub Desktop.
Save joewils/7755181 to your computer and use it in GitHub Desktop.
Login to BarraOne BDTI service using Node.js with the soap and soap-cookie packages.
var soap = require('soap'),
Cookie = require('soap-cookie'),
util = require('util'),
wsdl = 'bdti.wsdl';
soap.createClient(wsdl, function(err, client) {
client.Login({User: "USERNAME", Client: "CLIENTID", Password: "PASSWORD"}, function(err, result) {
// Cookie based security
client.setSecurity(new Cookie(client.lastResponseHeaders));
// GetCalcServers (This action requires login.)
client.GetCalcServers({}, function(err, result) {
console.log(util.inspect(result.body));
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment