Ionic Soap Xml web services

Its Simple…,:grinning:
Below code for how to call Soap Web Service from IONIC 2/3

Input:

<?xml version="1.0" encoding="utf-8"?> \
    <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/"> \
      <soap:Body> \
        <**WebMethodName** xmlns="http://tempuri.org/"> \
          <_Param1_>test</_Param1_> \
          <_Param2_>test2</_Param2_> \
        </**WebMethodName** > \
      </soap:Body> \
    </soap:Envelope>

Header:

this.headers = {
    responseType: "text",
    headers: new HttpHeaders()
      .set('Content-Type', 'text/xml; charset=utf-8')
  };

Http Call:
use http client

 this.http.post('http://localhost/yourwebservice.asmx', input, this.headers)
      .subscribe((response) => {
       let result = new DOMParser().parseFromString(res,"text/xml").getElementsByTagName("**WebMethodName**Result")[0].innerHTML;
 }, (error) => {
       \\Error Block
      });

This works fine for me :sunglasses:

2 Likes