title: Using Node to call SOAP Web Service over https
body: <p>I am trying to use node-soap <a href="https://github.com/vpulim/node-soap" rel="nofollow noreferrer">https://github.com/vpulim/node-soap</a> to call a web service but I am having trouble using the module with <strong>https</strong>. </p>
  
  <p>In the code below I am using <strong>http</strong> and I can see the functions and log a <code>describe()</code> of the <code>About</code> function. (Responses are empty, probably because the WS is setup like that when using http(?))</p>
  
  <pre><code>var soap = require('soap');
  var url = "http://XXXXX/service.svc?DocArchiveService/DocArchiveV201409";
  var auth = "Basic " + new Buffer("USERXXX" + ":" + "PWYYY").toString("base64");
  
  var args = {};
  
  soap.createClient(url, { wsdl_headers: {Authorization: auth} }, function(err, client) {
  
      console.log(client.describe().DocArchiveV201409.DocArchiveV201409Soap.About);
  
      client.DocArchiveV201409.DocArchiveV201409Soap.About(args, function(err, result){
          if (err) throw err;
          console.log(result);
      });
  });
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>{ input: {}, output: { AboutResult: 's:string' } }
  </code></pre>
  
  <p>Error message (this is fine since the response will be empty anyway):</p>
  
  <blockquote>
    <p>Error: Cannot parse response
        at finish (E:\Qlikview\SourceDocuments\UnderDevelopment\Node\node_modules\so
    ap\lib\client.js:383:19)</p>
  </blockquote>
  
  <p><strong>My problem is that when using https I get an undefined client.</strong></p>
  
  <blockquote>
    <p>E:\Qlikview\SourceDocuments\UnderDevelopment\Node\Soap.js:23
    console.log(client);
                ^ ReferenceError: client is not defined
        at Object.anonymous (E:\Qlikview\SourceDocuments\UnderDevelopment\Node\Soa p.js:23:13)</p>
  </blockquote>
  
  <p>Have anyone used node-soap with https? </p>
  
  <p><strong>edit:</strong>
  As the result below suggests I need to have the certificate first. I have tried using SoapUI without the cert and that works fine. Maybe there is some parameters to <code>createClient</code> I can use in node-soap?</p>
  
  <p>console.log(err) returns:</p>
  
  <pre><code>{ Error: unable to get local issuer certificate
      at Error (native)
      at TLSSocket.&lt;anonymous&gt; (_tls_wrap.js:1079:38)
      at emitNone (events.js:86:13)
      at TLSSocket.emit (events.js:185:7)
      at TLSSocket._finishInit (_tls_wrap.js:603:8)
      at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38) code: 'UNABLE_TO_GET_IS
  SUER_CERT_LOCALLY' }
  </code></pre>