Forum Discussion
How to get data from a SOAP WS with Power BI
After getting into it more and more I have to say its getting easier. I have been able to build functioning connectors on several SOAP webservices now thanks to the people in this thread, other threads and some hard trial and error.
Today I had a service that in a response gives only 100 records. You need to input:
- Mark (timestamp value from which timestamp onwards you want to receive)
The response gives:
- Data (100 records)
- Mark (Timestamp value)
- More (Whether more data is available)
The service will send the first 100 records that have never been seen before by me first if you use the correct mark. The correct mark is the mark used in the last response of the server. If you use the incorrect mark it will start sending all data never seen by me up untill the mark and all data after the mark regardless whether I have seen it or not.
I have been struggling all day to figure out a way to use the mark sent by the server in my next request and eval the more value in the response,
In below example, GetTraces(mark as text, customer as text, creds as text) is a function that collects a response from the server with a mark of a specific customer number, creds contains the basis authentication base encoded value,
This is what I came up with in the end to keep generating requests with the correct mark untill the more value is false:, may it help someone
a = List.Generate( () => [Page = GetTraces(mark, customer, creds)],
each [Page]{0}[more] <> "false",
each [Page = GetTraces([Page]{0}[mark], customer, creds)]I process the resulting list further into the correct table in the Power BI GUI and past the resulting code in my connector code.