Created
December 2, 2013 19:06
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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