Created
January 28, 2012 19:50
-
-
Save gsmcwhirter/1695565 to your computer and use it in GitHub Desktop.
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 qs = require("querystring"), | |
xml2js = require("xml2js"), | |
parser = new xml2js.Parser(), | |
config = require("../config"), | |
crypto = require("crypto"), | |
tar = require("tar"), | |
fs = require("fs"); | |
var parseBody = function(body, callback) { | |
var decodedBody = decodeURIComponent(qs.stringify(qs.parse(body))); | |
parser.parseString(decodedBody, callback); | |
}; | |
exports.startSession = function(req, res) { | |
var body = ''; | |
var parsedbody = ''; | |
var renderStartSession = function(err, data) { | |
var obj = data["SOAP-ENV:Body"]["ns1:StartSession"]; | |
var credential = md5HexDigest(obj.macaddress + obj.cnonce + config.cards[obj.macaddress].uploadkey); | |
res.send('WILD RESPONSE'); | |
}; | |
req.on('data', function (data) { | |
body += data; | |
}); | |
req.on('end', function () { | |
parseBody(body, renderStartSession); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment