title: Import WSDL file into Javascript
body: <p>I want to import a WSDL in XML file to my JavaScript project, which will allow my to use web client to search info. </p>
  
  <p>Is there any special way to import it into my project, or do I need a package, or need to convert it into JS? I know there is a soap package in NPM, but I hope it's not the only way to do that. I've also read tutorials on W3 and still not quite sure how to manage that. </p>
  
  <p>I've got something like this:</p>
  
  <pre><code>    function soap() {
          var xmlhttp = new XMLHttpRequest();
          xmlhttp.open('POST', '127.0.0.1/start.html', true);
  
          // build SOAP request
          var sr =
                  '&lt;soapenv:Envelope ' +
                      'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' +
                      'xmlns:aut="http://demo.krd.pl/Authorization" xmlns:dto="http://demo.krd.pl/Chase3.1/Dto"&gt; ' +
                      '&lt;soapenv:Header&gt; ' + 
                          '&lt;aut:Authorization&gt; '+
                              '&lt;aut:AuthorizationType&gt;LoginAndPassword&lt;/aut:AuthorizationType&gt; ' +
                              '&lt;aut:Login&gt;login&lt;/aut:Login&gt; ' +
                              '&lt;aut:Password&gt;password&lt;/aut:Password&gt; ' +
                          '&lt;/aut:Authorization&gt; ' +
                      '&lt;/soapenv:Header&gt; ' +
                      '&lt;soapenv:Body&gt; ' +
                          '&lt;dto:SearchNonConsumerRequest&gt; ' +
                              '&lt;dto:Number&gt;24041803749&lt;/dto:Number&gt; ' +
                              '&lt;dto:NumberType&gt;TaxId&lt;/dto:NumberType&gt; ' +
                          '&lt;/dto:SearchNonConsumerRequest&gt; ' +
                      '&lt;/soapenv:Body&gt; ' +
                  '&lt;/soapenv:Envelope&gt; ';
  
          xmlhttp.onreadystatechange = function () {
              if (xmlhttp.readyState == 4) {
                  if (xmlhttp.status == 200) {
                      alert('done. use firebug/console to see network response');
                  }
              }
          }
          // Send the POST request
          xmlhttp.setRequestHeader('Content-Type', 'text/xml');
          xmlhttp.send(sr);
          // send request
          // ...
      }
  </code></pre>
  
  <p>Also, where the response will be saved or will it just be posted in console?</p>