# How to call SOAP Api in ionic 3

**URL:** <https://forum.ionicframework.com/t/how-to-call-soap-api-in-ionic-3/114418>\
**Category:** ionic-v3\
**Created:** [December 5, 2017, 1:04pm UTC](https://forum.ionicframework.com/t/how-to-call-soap-api-in-ionic-3/114418 "2017-12-05T13:04:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwlogix](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@cwlogix](https://forum.ionicframework.com/u/cwlogix)\
**Post date:** [December 5, 2017, 1:04pm UTC](https://forum.ionicframework.com/t/how-to-call-soap-api-in-ionic-3/114418/1 "2017-12-05T13:04:20Z")

</div>

Can you tell me anyone. How to call SOAP Api in ionic 3.

---

<div class="post-metadata">

**Author:** ![shibendutta](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@shibendutta](https://forum.ionicframework.com/u/shibendutta)\
**Post date:** [February 16, 2018, 11:53am UTC](https://forum.ionicframework.com/t/how-to-call-soap-api-in-ionic-3/114418/2 "2018-02-16T11:53:29Z")

</div>

Hi i have followed [SOAP - WSDL request angular2/4 framework](https://stackoverflow.com/questions/46296983/soap-wsdl-request-angular2-4-framework)

I have followed this but still get an error `stauts 0` response null

Do let me know if you have found any solution to this. Below is my code to call a SOAP service

```auto
soapCall() {
    let xmlhttp = new XMLHttpRequest();
    xmlhttp.open('GET', 'https://xxxxxxxxx/xxxxxxx/wsdl/xxxxx.wsdl', true, 'username@example.com', 'SomePassword');
    let sr =
        `<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:max="http://www.ibm.com/maximo">
        <soap:Header/>
        <soap:Body>
        <arguments>Some arguments</arguments>
        </soap:Body>
     </soap:Envelope>`;

    xmlhttp.onreadystatechange = () => {
        if (xmlhttp.readyState == 4) {
            if (xmlhttp.status == 200) {
                let xml = xmlhttp.responseXML;
                alert(xmlhttp.responseText);
            }else{
              alert('XML response ' + xmlhttp.responseXML);
              alert(xmlhttp.status);
            }
        }
    }
    // Send the POST request
    xmlhttp.setRequestHeader('Content-Type', 'application/soap+xml');
    xmlhttp.responseType = "document";
    xmlhttp.send(sr);
  }

```

The response that i am getting is from the else part

else{  
alert('XML response ’ + xmlhttp.responseXML);  
alert(xmlhttp.status);  
}

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 10:00pm UTC](https://forum.ionicframework.com/t/how-to-call-soap-api-in-ionic-3/114418/3 "2021-07-19T22:00:46Z")

</div>

Closed on July 19, 2021, 10:00pm UTC


