I try to deploy my node application inside the "IIS 8". I have installed iisnode.
The basic application is running perfectly.
But I go with SOAP, I am getting below error.
Application has thrown an uncaught exception and is terminated:
TypeError: Cannot read property 'setSecurity' of undefined
at C:\inetpub\iisnode\www\salesorder\so.js:32:11
at C:\inetpub\iisnode\www\salesorder\node_modules\strong-soap\src\soap.js:48:5
at C:\inetpub\iisnode\www\salesorder\node_modules\strong-soap\src\soap.js:30:16
at ReadFileContext.callback (C:\inetpub\iisnode\www\salesorder\node_modules\strong-soap\src\parser\wsdl.js:370:11)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:336:13)
Code:
var express = require('express');
var app = express();
app.get('/node/salesorder/myapp/salesorderquery', function(req, res){
var json = req.query;
var soap = require('strong-soap').soap;
var url = '../wsdl/SalesOrderQuery.wsdl';
var requestArgs = {
SalesOrderByElementsQuery_sync : {
ProcessingConditions : {
QueryHitsMaximumNumberValue : 2 , //json.QueryHitsMaximumNumberValue,
QueryHitsUnlimitedIndicator : false,
LastReturnedObjectID : "0000000000011ED18B8B8EA6C678AAE6"
}
}
};
var options = {
attributesKey: '$attributes'
};
soap.createClient(url, options, function(err, client) {
client.setSecurity(new soap.BasicAuthSecurity("**APP","******"));
client.FindByElements(requestArgs, function(err, result, envelope) {
res.send(JSON.stringify(result));
});
});
})
app.listen(process.env.PORT);
Please help me solve this problem.
Regards Sankaran A