title: Call SOAP API from nodejs and use(json) response data
body: <p>I call a SOAP API from POSTMAN it is working fine. Now I want to use it with Node.js(nextjs).
  This is how i am calling API and what I am getting.
  <a href="https://i.stack.imgur.com/h5aPD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h5aPD.png" alt="enter image description here" /></a></p>
  <p>How i will call this and get a json response?
  Now i am calling like this-</p>
  <pre><code>const xml =
    &quot;&lt;?xml version='1.0' encoding='utf-8'?&gt;&lt;soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'&gt;&lt;soap:Body&gt;&lt;HourlyTransactions xmlns='https://secure.myterminals.com/ConfigStatusSyncService'&gt;&lt;StartTime&gt;2020-12-17 00:00&lt;/StartTime&gt;&lt;EndTime&gt;2020-12-18 00:00&lt;/EndTime&gt;&lt;Login&gt;&lt;/Login&gt;&lt;Password&gt;&lt;/Password&gt;&lt;/HourlyTransactions&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;&quot;;
    
    let res = await fetch(
      &quot;https://secure.myterminals.com/ConfigStatusSyncService/DataQuery.asmx&quot;,
      {
        method: &quot;POST&quot;,
        headers: { &quot;Content-Type&quot;: &quot;text/xml&quot; },
        body: xml,
      }
      );
      console.log(res);
  </code></pre>