Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm having trouble trying to parse a XML SOAP response in Qlik, using the REST connector and hoping someone could help me out.
I'm not very experienced in the subject, but I've managed to get the response. The problem is that it comes in a single field and I don't know how parse it as a table.
1. I've set the body and header in the REST connector, and added the wsdl as the URL request. If I click "test connection" it says "succeeded".
2. If I click on the "select data" button in the connector, it opens the preview table, but it automatically is read as a CSV. If I change the option to XML, only the headers will show in the preview (no data is retrieved), while the CSV will show the actual response data encapsulated in a single cell.
(if I hover the value I see the same response I get in postman, which is correct)
(XML doesn't return values, but only these columns)
How can I display this response as table in Qlik?
PS: I've noticed the response I get carries "<" and ">" which I found out to be the "<>" chars. Not sure if it's relevant.
In the REST connection you must place the following content in the Query headers:
Name: Content-Type
Value: text/xml; charset=utf-8
Then just test the connection and save.
The next step is to click on select data and select the last XML tag.
The API used in the test returns the name of the list of countries
Enpoint api: http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso
Request Body:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<ListOfCountryNamesByName xmlns="http://www.oorsprong.org/websamples.countryinfo">
</ListOfCountryNamesByName>
</soap12:Body>
</soap12:Envelope>
Query headers: Name: Content-Type: Value: text/xml; charset=utf-8
Hi!
Thanks for the reply.
As for the headers, I had exactly that, but still it doesn't work.
I tested the API you provided for the list of countries, and funny thing is that it happens the same!
What am I missing?
I did exactly that. Then went to "select data" and it automatically recognizes it as a CSV file. If I change the response type to XML it gives me the same structure (which relates to the SOAP config columns I guess):
This is the setup I've used with the example you provided:
Actually, I just realized that the "menu" in the "select data" can be expanded from Envelope > Body > etc.
The API you provided as an example did work and gave me a table with the data, but the one I'm using gives me no results (only if I identify the data as a CSV, then it gives me a column with the raw response in a single field as mentioned before)
I'm almost convinced that it has to do with the response structure that is not properly parsed in tags and therefore not recognized by Qlik.
If I call the API you provided in Postman, I get a nice structured response, differently from the API I'm trying to consume:
I once went through a similar problem, I solved it by generating an XML file of the response and dragging it to qlik in the data manager, qlik generated the script automatically and then I copied the script and processed it as I needed, I suggest you do this test.