title: Soap server using node js
body: <p>I'm trying to create a soap service with node js. It seems like the most common to do this is to use this lib: <a href="https://www.npmjs.com/package/soap" rel="noreferrer">https://www.npmjs.com/package/soap</a></p>
  
  <p>They have this snippet:</p>
  
  <pre><code>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 &amp; middleware will continue to work
      soap.listen(app, '/wsdl', myService, xml);
  });
  </code></pre>
  
  <p>my question is. Do I need generate this file: myservice.wsdl manually and later link it with the structure MyService?</p>
  
  <p>Thanks</p>