title: TypeError when trying to call National Rail SOAP API via Node
body: <p>I'm trying to access the National Rail API using <a href="https://github.com/vpulim/node-soap%20%22node-soap" rel="nofollow">node-soap</a>.</p>
  
  <p>Documentation is here: <a href="https://lite.realtime.nationalrail.co.uk/OpenLDBWS/" rel="nofollow">https://lite.realtime.nationalrail.co.uk/OpenLDBWS/</a></p>
  
  <p>I am new to SOAP so this might not be an issue with the API. I am getting a TypeError with whatever I attempt...</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'Body' of undefined</p>
  </blockquote>
  
  <p>Here is the code I am using to try and make a call:</p>
  
  <pre><code>var soap = require('soap');
  var url = 'https://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx?ver=2014-02-20';
  var soapHeader = '&lt;com:AccessToken&gt;MY_TOKEN&lt;/com:AccessToken&gt;';
  
  soap.createClient(url, function(err, client){
  
    var args = {
      numRows : 10,
      crs : 'LAN'
    };
  
    client.addSoapHeader(soapHeader);
  
    client.GetDepartureBoard(args, function(err, result){
      if(err){
        console.log('error!');
        throw err;
      }
      console.log(result);
    });  
  });
  </code></pre>
  
  <p>Using node-soap I can also get the request envelope, this is the contents:</p>
  
  <pre><code>&lt;soap:Envelope
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:tns="http://thalesgroup.com/RTTI/2014-02-20/ldb/"
      xmlns:tok="http://thalesgroup.com/RTTI/2013-11-28/Token/types"
      xmlns:ct="http://thalesgroup.com/RTTI/2007-10-10/ldb/commontypes"
      xmlns:ldbt="http://thalesgroup.com/RTTI/2012-01-13/ldb/types"
      xmlns:ldbt2="http://thalesgroup.com/RTTI/2014-02-20/ldb/types"&gt;
      &lt;soap:Header&gt;
          &lt;com:AccessToken&gt;MY_TOKEN&lt;/com:AccessToken&gt;
      &lt;/soap:Header&gt;
      &lt;soap:Body&gt;
          &lt;tns:GetDepartureBoardRequest
              xmlns:tns="http://thalesgroup.com/RTTI/2014-02-20/ldb/"
              xmlns="http://thalesgroup.com/RTTI/2014-02-20/ldb/"&gt;
              &lt;tns:numRows&gt;10&lt;/tns:numRows&gt;
              &lt;tns:crs&gt;LAN&lt;/tns:crs&gt;
          &lt;/tns:GetDepartureBoardRequest&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>