title: SOAP client TypeScript
body: <p>I'm using this lib: <a href="https://github.com/vpulim/node-soap" rel="nofollow noreferrer">https://github.com/vpulim/node-soap</a>, to get data from an API. I have a file caled apiDecoder.ts with the following code:</p>
  
  <pre><code>     class NuSoapClient{
  
          public GetNuSoapInfo():string{
  
              var soap = require('soap')
              var url  = "https://my.url.com/consultNFSe/server.php?wsdl"
              var args = {token. :"mysecrettoken",
                          doc    : "000000000",
                          number : "000000000"
                         }
  
              soap.CreateClient(url, function(err, client){
                  client.MyFunction(args, function(err, result){
                      console.log(result);
                  });
              });
              return
          }
       }
  
  var nf = new NuSoapClient()
  nf.GetNuSoapInfo()
  console.log(nf)
  </code></pre>
  
  <p>I get the following error when I compile the code:</p>
  
  <pre><code>  " SyntaxError: Unexpected identifier
      at Module._compile (internal/modules/cjs/loader.js:895:18)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
      at Module.load (internal/modules/cjs/loader.js:815:32)
      at Function.Module._load (internal/modules/cjs/loader.js:727:14)
      at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
      at internal/main/run_main_module.js:17:11 "
  </code></pre>
  
  <p>PS: I was coding the same function in PHP (OO too), there is a missing argument that I didn't get the way to use in TypeScript, the "consultaNFSe" on $res variable. It defines who I'm calling in the API. Here's the working PHP code with Nusoap lib:</p>
  
  <pre><code>$client     = new nusoap_client('https://my.url.com/consultNFSe/server.php?wsdl'); 
  $parameters =  array('token'=&gt; $results-&gt;token,
                            'cnpj'=&gt; $results-&gt;cnpj,
                           'nrNota'=&gt; $results-&gt;nota);
  
  $res      = $client-&gt;call('consultaNFSe', $parameters);
  $contents = file_get_contents("data.php");
  $arr      = json_decode($res, true);
  </code></pre>
  
  <p>Any thoughts? I'm stuck at this point.</p>