title: ReferenceError: $http is not defined
body: <p>I am trying to make a SOAP call through node.js and am getting the below error:</p>
  
  <pre><code>ReferenceError: $http is not defined
  </code></pre>
  
  <p>Here is my code, everything else appears to work until it fails at the last line:</p>
  
  <pre><code>//Import the `assert` module to validate results.
  var assert = require('assert');
  var SoapRequestXML='&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:_5="https://clients.mindbodyonline.com/api/0_5"&gt;\r\n' +
                     '&lt;soapenv:Header/&gt;\r\n' +
                     '&lt;soapenv:Body&gt;\r\n' +
                     '&lt;_5:GetClasses&gt;\r\n' +
                     '&lt;_5:Request&gt;\r\n' +
                     '&lt;_5:SourceCredentials&gt;\r\n' +
                     '&lt;_5:SourceName&gt;SOURCECREDENTIALS&lt;/_5:SourceName&gt;\r\n' +
                     '&lt;_5:Password&gt;PASSWORD&lt;/_5:Password&gt;\r\n' +
                     '&lt;_5:SiteIDs&gt;\r\n' +
                     '&lt;_5:int&gt;-99&lt;/_5:int&gt;\r\n' +
                     '&lt;/_5:SiteIDs&gt;\r\n' +
                     '&lt;/_5:SourceCredentials&gt;\r\n' +
                     '&lt;/_5:Request&gt;\r\n' +
                     '&lt;/_5:GetClasses&gt;\r\n' +
                     '&lt;/soapenv:Body&gt;\r\n' +
                     '&lt;/soap:Envelope&gt;';
  
  
  var options = {
      //Define endpoint URL.
      url: "https://api.mindbodyonline.com/0_5/ClassService.asmx",
      //Define body of POST request.
      body: SoapRequestXML,
      //Define insert key and expected data type.
      headers: {
           'POST': 'https://api.mindbodyonline.com/0_5/ClassService.asmx?wsdl HTTP/1.1',
           'Accept-Encoding': 'gzip,deflate',
           'Content-Type': 'text/xml;charset=UTF-8',
           'SOAPAction': '"http://clients.mindbodyonline.com/api/0_5/GetClasses"',
           'Content-Length': '594',
           'Host': 'api.mindbodyonline.com',
           'Connection': 'Keep-Alive',
           'User-Agent': 'Apache-HttpClient/4.1.1 (java 1.5)'
  
  
          }
  };
  
  //Define expected results using callback function.
  function callback(error, response, body) {
      //Log status code to Synthetics console.
      console.log(response);
      //Verify endpoint returns 200 (OK) response code.
      assert.ok(response.statusCode == 200, 'Expected 200 OK response');
      //Parse JSON received from Insights into variable.
      //
     var parseString = require('xml2js').parseString;
     var XMLReSULT = response.body;
     parseString(XMLReSULT, function (err, result) {
      console.dir(result);
  
     });
  
      //Log end of script.
      console.log("End reached");
  }
  
  //Make GET request, passing in options and callback.
  $http.post(options, callback);
  </code></pre>
  
  <p>Any help is appreciated, I am very new at this. </p>