ReferenceError: WSDL is not defined
This is my code
var soap = require('soap')
, http = require('http')
var smsApi = {
SmsApiService: {
MoSmsPort: {
smsMoSync: function (args) {
return 'Thxs!!!';
}
}
}
}
var xml = require('fs').readFileSync('/sites/texty/moSmsApi.wsdl', 'utf8');
var server = http.createServer(function(request,response) {
response.end('404: Not Found: ' + request.url)
});
server.listen(8000);
soap.listen(server, '/wsdl', smsApi, xml);
And I get this....
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: WSDL is not defined
at Object.listen (/sites/texty/node_modules/soap/lib/soap.js:33:20)
at Object.
@imd23 hey can u post the wsdl some where? I would love to replicate this issue...
http://pastebin.com/BDpCY7N3
I meet the same problem too.
In soap.js, add the var declare as below WSDL = require('./wsdl').WSDL; and It's ok. It's a base mistake.
great, now I get this
node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Cannot call method 'shift' of undefined at [object Object].processIncludes (/sites/texty/node_modules/soap/lib/wsdl.js:495:61) at Array.0 (/sites/texty/node_modules/soap/lib/wsdl.js:477:14) at EventEmitter._tickCallback (node.js:192:40) worker 22542 died
The error occured at the wsdl paring step, so maybe your wsdl has error. I have not met the error.
It works perfectly with php soap class
A workaround is to insert into WSDL.prototype.processIncludes (wsdl.js, line 495) a check for existence of includes:
var self = this,
uri = this.definitions && this.definitions.includes && this.definitions.includes.shift();
fixed
thx