title: How to make a Soap call in React js?
body: <p>I have tried a few ways to make a Soap call through  Reactjs. But I am always facing some error in every approach. Can someone help me out here or kindly provide me with any small working example so that I could refer it?</p>
  
  <p>I had tried using the <strong>npm soap</strong> and <strong>easysoap</strong> package but I am not able to succeed. Any working example is greatly appriciated.
  I also tried the following way but it too doesn't work.</p>
  
  <pre><code>var xmlhttp = new XMLHttpRequest();
  xmlhttp.open('GET', '{My soap endpoint}', true);
  
  // build SOAP request
  var sr =
      '&lt;soap:Envelope xmlns:soap="{My soap request}"'
  
  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);
  </code></pre>