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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
simonliucan
Frequent Visitor

xml API call not working

Hi folks,

 

I was trying to make API call using xml in Power Query but it's not working. It either gives error message "Internal Server Error 500", or returns HTTP code 200, but with Content Length = -1. I use the same xml in SoapUI and it returns data successfully. Is it because format issue (quotation marks?), or incorrect functions I use? 

simonliucan_0-1651178600307.png

 

Thanks,

 

1 ACCEPTED SOLUTION

Yes problem solved, I just separate xml.tables(web.comtents)) into 2 steps:

Source = web.comtents(SourceURL, content=..., header = options)

XMLTable = Xml.Tables(Source)

......

and it worked.

thanks for all your reply.

 

View solution in original post

8 REPLIES 8
v-jingzhang
Community Support
Community Support

Hi @simonliucan 

 

Did you manage to solve this problem? If not, maybe you can share how you set up the request in SoapUI with screenshots (removing sensitive info). We can help check whether some small details have been neglected. If you have solved it, can you share the final solution here to help the community?

 

Best Regards,
Community Support Team _ Jing

Yes problem solved, I just separate xml.tables(web.comtents)) into 2 steps:

Source = web.comtents(SourceURL, content=..., header = options)

XMLTable = Xml.Tables(Source)

......

and it worked.

thanks for all your reply.

 

@simonliucan 

 

Odd, splitting 1 step into 2 should not fix it.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

Hi @simonliucan 

 

Like this

Web.Contents( "https://www.website.com", 
                  
                     [ 

                         RelativePath = "OrderService.cfc",

                         Query = [wsdl = YourText]

                     ] 
)

 

regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thanks Phil.

But I still don't understand, I have already put the xml in the "Body" (see my screenshot), which is the wsdl I believe? What should I put in the query section?

Hi @simonliucan 

 

The point I'm trying to make is that if you are supplying the request in the Body then do you need to also supply an empty query parameter called wsdl ?

If the request Body contains everything required by the API for a successful request, then why are you also supplying wsdl in the query parameters?

Try removing ?wsdl from the SourceURL.

 

Another thing you could try : all the URL's in your body are HTTP.  They actually redirect to HTTPS if you try to access them in your browser.  So try changing them all to HTTPS e.g. https://www.w3.org/2001/XMLSchema

 

Please bear in mind that I have no access to your API to test it and I have no idea how it works so I am offering advice based on what looks like it might be causing issues.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

Hi @simonliucan 

 

Your SourceURL contains a named query parameter wsdl but you aren't provinding a value for this.  You can try either removing the wsdl part or supplying a value for.

 

Also, try just setting the SoureURL as the website domain e.g. 

 

SourceURL = "htps://www.website.com"

 

 

Then specify the subfolder using the RelativePath e.g.

 

Web.Contents( "https://www.website.com", [ RelativePath = "OrderService.cfc" ] )

 

 

Query Parameters like wsdl can also be specified using the Query field of the Options record, see the documentation:

 

Web.Contents - PowerQuery M | Microsoft Docs

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thanks Phil, can you give me an exmaple of how to specify wsdl using querying field?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors