简体   繁体   中英

How do you create node-soap wsdl file?

I am reading node-soap documentation on how to create a server web-service. I understand everything concerning creating a web-service except how myservice.wsdl (as per the code snippet below) is created. If someone has created a web-service as per the node-soap documentation please guide me as to how I should create the wsdl file. Thank you in advance.

  var myService = { MyService: { MyPort: { MyFunction: function(args) { return { name: args.name }; }, // This is how to define an asynchronous function. MyAsyncFunction: function(args, callback) { // do some work callback({ name: args.name }); }, // This is how to receive incoming headers HeadersAwareFunction: function(args, cb, headers) { return { name: headers.Token }; }, // You can also inspect the original `req` reallyDetailedFunction: function(args, cb, headers, req) { console.log('SOAP `reallyDetailedFunction` request from ' + req.connection.remoteAddress); return { name: headers.Token }; } } } }; var xml = require('fs').readFileSync('myservice.wsdl', 'utf8'); //http server example var server = http.createServer(function(request,response) { response.end('404: Not Found: ' + request.url); }); server.listen(8000); soap.listen(server, '/wsdl', myService, xml); //express server example var app = express(); //body parser middleware are supported (optional) app.use(bodyParser.raw({type: function(){return true;}, limit: '5mb'})); app.listen(8001, function(){ //Note: /wsdl route will be handled by soap module //and all other routes & middleware will continue to work soap.listen(app, '/wsdl', myService, xml); }); 

None of the Node.js SOAP modules (to my knowledge) create a WSDL file for you.

What you can do is use a service to create the WSDL.

An example is http://marin.jb.free.fr/wsdl/ , you can use this to create the WSDL file for whatever service you wish.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM