Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

How To Call A SOAP Web Service From QlikView & Qlik Sense using Qlik Web Connectors (Manual Example)

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Bjorn_Wedbratt
Former Employee
Former Employee

How To Call A SOAP Web Service From QlikView & Qlik Sense using Qlik Web Connectors (Manual Example)

Last Update:

May 17, 2021 8:33:09 AM

Updated By:

Sonja_Bauernfeind

Created date:

Jul 1, 2016 10:08:52 AM

The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

In this example, we show how the General Web Connector can be used to call a SOAP web service. The web service we will use is an example from w3schools which converts Celsius to Fahrenheit. The screen shots in this tutorial are from V1 of this connector however the same technique applies to the new UI in V2 of the connector.

 

Environment:

QlikView 
Qlik Web Connectors 

 

Note here we construct the request manually. We have also found this tool useful (there is a free edition) in figuring out the SOAP request to make for other services.

We start by looking at the XML request specification:

webservices asmx.png

We note that it requires a POST request to: www.w3schools.com//webservices/tempconvert.asmx

And enter this into the connector as shown:

post method qvsource.png

Next, we note that the content type for the request is: text/xml

content-type text xml.png

And enter this into the connector also:

content type.png

Finally, we note the request XML which should be posted to the web service:

string.png

<?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>
    <CelsiusToFahrenheit xmlns="http://tempuri.org/">
      <Celsius>100</Celsius>
    </CelsiusToFahrenheit>
  </soap:Body>
</soap:Envelope>

We now enter this as the POST value in the connector. Currently we must also first convert this to a single line of text, i.e.:

<?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><CelsiusToFahrenheit xmlns="http://tempuri.org/"><Celsius>100</Celsius></CelsiusToFahrenheit></soap:Body></soap:Envelope>

The connector config now looks like this:

post parameters.png

Note, some SOAP services might also require you to enter the SOAPAction header. In this case the SOAP service works even if we do not enter it, but if you find your SOAP requests are failing please ensure that you have configured the accept, content type and SOAPAction header before contacting us for support.

We can now use the RawResponse table inQlik Web Connectors to inspect the result:

rawresponse.png

Depending on the structure of the response, we could either use one of the other tables in this connector along with an XPATH expression to extract a properly structured QlikView table load script

Alternatively, we can simply grab the raw request URL:

click here request url.png

And use this as the source for a web file load in QlikView:

internet file.png

Now we can see the result appear in the response:

file wizard xml.png

We now have a QlikView load script that looks like this, with the request parameter (of 100) buried somewhere in the URL:

LOAD xmlns:soap,
    xmlns:xsi,
    xmlns:xsd,
    [Body/CelsiusToFahrenheitResponse/xmlns] as xmlns,
    [Body/CelsiusToFahrenheitResponse/CelsiusToFahrenheitResult] as CelsiusToFahrenheitResult
FROM [http://localhost:5555/QVSource/WebConnectorV2/?table=RawResponse&appID=&verb=post&contentType=text%2fxml&data=%3C%3fxml+version%3d%221.0%22+encoding%3d%22utf-8%22%3f%3E%3Csoap%3aEnvelope+xmlns%3axsi%3d%22http%3a%2f%2fwww.w3.org%2f2001%2fXMLSchema-instance%22+xmlns%3axsd%3d%22http%3a%2f%2fwww.w3.org%2f2001%2fXMLSchema%22+xmlns%3asoap%3d%22http%3a%2f%2fschemas.xmlsoap.org%2fsoap%2fenvelope%2f%22%3E%3Csoap%3aBody%3E%3CCelsiusToFahrenheit+xmlns%3d%22http%3a%2f%2ftempuri.org%2f%22%3E%3CCelsius%3E100%3C%2fCelsius%3E%3C%2fCelsiusToFahrenheit%3E%3C%2fsoap%3aBody%3E%3C%2fsoap%3aEnvelope%3E&url=http%3a%2f%2fwww.w3schools.com%2fwebservices%2ftempconvert.asmx] (XmlSimple, Table is [Envelope]);

We can quickly factor this out into an input parameter and a result parameter as shown here:

let vInput = 100;
 
Envelope:
LOAD xmlns:soap,
    xmlns:xsi,
    xmlns:xsd,
    [Body/CelsiusToFahrenheitResponse/xmlns] as xmlns,
    [Body/CelsiusToFahrenheitResponse/CelsiusToFahrenheitResult] as CelsiusToFahrenheitResult
FROM [http://localhost:5555/QVSource/WebConnectorV2/?table=RawResponse&appID=&verb=post&contentType=text%2fxml&data=%3C%3fxml+version%3d%221.0%22+encoding%3d%22utf-8%22%3f%3E%3Csoap%3aEnvelope+xmlns%3axsi%3d%22http%3a%2f%2fwww.w3.org%2f2001%2fXMLSchema-instance%22+xmlns%3axsd%3d%22http%3a%2f%2fwww.w3.org%2f2001%2fXMLSchema%22+xmlns%3asoap%3d%22http%3a%2f%2fschemas.xmlsoap.org%2fsoap%2fenvelope%2f%22%3E%3Csoap%3aBody%3E%3CCelsiusToFahrenheit+xmlns%3d%22http%3a%2f%2ftempuri.org%2f%22%3E%3CCelsius%3E$(vInput)%3C%2fCelsius%3E%3C%2fCelsiusToFahrenheit%3E%3C%2fsoap%3aBody%3E%3C%2fsoap%3aEnvelope%3E&url=http%3a%2f%2fwww.w3schools.com%2fwebservices%2ftempconvert.asmx] (XmlSimple, Table is [Envelope]);
 
let vResult = Peek('CelsiusToFahrenheitResult', 0);

Using steps similar to the above it should be possible to call a wide range of SOAP Web Services from QlikView using Qlik Web Connectors. Some web services might have authentication schemes that are not yet supported by the connector or have more complex request parameters which make the above less straightforward.

Contributors
Version history
Last update:
‎2021-05-17 08:33 AM
Updated by: