Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dramus
Continued Contributor
Continued Contributor

Calling multiple SOAP calls

I have a business need to grab data from a cloud source that requires multiple SOAP calls to complete.

 

The process is as follows:

  1. Login
  2. Execute Report
  3. Download Report results
  4. Logout.

Trying to impliment this through Power BI, Power Query and web.content(). Using Fiddler to diagnose what's going on I'm seeing multiple calls to each step, even though the PQ only calls each once. I've disabled "Parallel loading", "Detect Column Types", "Import relationships" and "Allow background refreshes".

Can anyone suggest a way in Power Query to limit the SOAP calls to a single request per call?

8 REPLIES 8
sean_cochran
Helper II
Helper II

Just curious if you ever found out a solution here - I have to go through a similar sequence to grab data from a soap API. Each of the steps works individually, but the sequencing is out of order and it's making multiple calls at one step.

dramus
Continued Contributor
Continued Contributor

I did, but it's "ugly" (i.e. outside of Power Query/Fabric). We use a logic app to do the heavy lifting of making all the calls to the SOAP API and then Power BI just calls the Logic app.

I had a suspicion that's where this would lead. So far I've tried one query with all the steps in sequence, I've tried separate queries, and I've tried storing request outputs in buffered lists... no success so far. I saw some guy turning requests into custom functions and harcoding a time delay between them, but that feels too brittle for comfort. Thanks for the response!

dramus
Continued Contributor
Continued Contributor

No problem, I'll look in the ideas forum to see if there is anything there, but it would be nice if we could create atomic sections in power query, be able to say that "this section has to happen s a single unit and in this order". it would make these caall to web API's that require a stepped approach (e.g. Login, Request data, Fetch Data) call possible.

Here's the Idea: Microsoft Idea

That would be really cool! Voted for the idea.

smpa01
Super User
Super User

@dramus Thanks for sharing this. There is one more thing I want to ask you.

 

The SOAP calls that you are making in this instance, you can make the same SOAP calls in browser and the responses are returned?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
smpa01
Super User
Super User

@dramus  just being curious, how do you make SOAP calls through PQ? I could not do that and I had a use case? I had to switch to powershell making SOAP calls and fetching data.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
dramus
Continued Contributor
Continued Contributor

SOAPEnvelope=
"<s:Envelope xmlns:s=""http://www.w3.org/2003/05/soap-envelope"" xmlns:a=""http://www.w3.org/2005/08/addressing""> 
<s:Header> 
<a:Action s:mustUnderstand=""1"">http://www.XXX.com/dataservices/bidata/DataService/ExecuteReport</a:Action>  
<a:To s:mustUnderstand=""1"">https://servicehost/services/DataService</a:To>  
</s:Header> 
<s:Body> 
<ExecuteReport xmlns=""http://www.XX.com/dataservices/bidata/""> 
<request xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""> 
<ReportPath>"&ReportPath&"</ReportPath>  
<ReportParameters> 
</ReportParameters> 
</request> 
<context xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""> 
<ServiceId>"&ServiceIDValue&"</ServiceId>  
<ClientAccessKey>"&MyKey&"</ClientAccessKey>  
<Token>"&TokenValue&"</Token>  
<Status>Ok</Status>  
<StatusMessage i:nil=""true"" />  
<InstanceKey>"&InstanceIDValue&"</InstanceKey>  
</context> 
</ExecuteReport> 
</s:Body> 
</s:Envelope> 
",
GetReportKey = Xml.Document(
    Web.Contents(
      "https://service2.XXX.com/services/DataService",
      [Content = Text.ToBinary(SOAPEnvelope), Headers = [#"Content-Type" = "application/soap+xml; charset=utf-8"]]
    )
  )

 

Here's an example from my PQ

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors