Forum Discussion
How to get data from a SOAP WS with Power BI
Your M code seems ok, the only difference I see with me is in your XML
you use <v20:clientLogin>
were i use </web:returnData>
I've removed the "SOAPAction =" "and now it's working.
Thank you
- hugoberry9 years ago
Responsive Resident
It seems that making SOAP more user firendly for PowerBI is because of lack of Xml create functions.
Has anyone tried to build an populate an Xml.Document type as per the MSDN document? https://msdn.microsoft.com/en-us/library/mt260907.aspx
Maybe if you start from there you can resolve a lot of SOAP comunication issues.
- juliovidigal9 years ago
Advocate I
Actually, the next step of my project was this, because I'm going to publish this and I do not find it interesting to keep calling files to make the call.
So now I've put the XML inside PowerQuery.Because I'm going to use the token return on other calls, it's unfeasible that it stays on file.
It looks like this:
let
Source = Xml.Tables(Web.Contents("https://advertising.criteo.com/API/v201305/AdvertiserService.asmx?WSDL"
,[Content=Text.ToBinary("<soapenv:Envelope xmlns="&Character.FromNumber(34)&"https://advertising.criteo.com/API/v201305"&Character.FromNumber(34)&" xmlns:soapenv="&Character.FromNumber(34)&"http://schemas.xmlsoap.org/soap/envelope/"&Character.FromNumber(34)&">
<soapenv:Body>
<clientLogin>
<username>[email protected]</username>
<password>aaaaaaaa</password>
</clientLogin>
</soapenv:Body>
</soapenv:Envelope>"),Headers=[#"Accept-Encoding"="gzip,deflate", #"Content-Type"="text/xml;charset=UTF-8"]]))
in
Source
- hugoberry9 years ago
Responsive Resident
Might want to consider using single quotes in your xml. Or if you need those double quoutes try using #(0022) in your query it is equivalent to Character.FromNumber(34), plus you don't need to concatenate them.
instead of
"<soapenv:Envelope xmlns="&Character.FromNumber(34)&"https"
try
"<soapenv:Envelope xmlns=#(0022)https"
Plus, have you considered using Text.Format to keep password and username out of the XML qurey builder?