我尝试在" IIS 8"中部署我的节点应用程序。我安装了iisnode。
基本应用程序运行正常。
但是我选择SOAP,我遇到了错误。
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)
代码:
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);
请帮我解决这个问题。
此致 Sankaran A