Forum Discussion
How to get data from a SOAP WS with Power BI
Been trying what you recommend in this thread for quite osme time now, but I am getting "Can not approve with the given credentials. Try again" when I am trying to retrieve my session token. My credentials are given in the xml-file while the connection type has been set to anonymous, so this should not make sense right?
I use the following code in the query:
let
Source = Xml.Tables(Web.Contents("https://xxx.xxxxx.com/wsapi/services/authentication?WSDL",[Content=File.Contents("xxxx\xxxxx\xxxxx.xml"),
Headers=[#"Accept-Encoding"="gzip,deflate", #"Content-Type"="text/xml;charset=UTF-8"]]))
in
SourceWhile the xml-file is the login-request for the api, only returning my username and password when I import the file to Power Bi independently:
Can you see anything wrong I am doing? Could JasonL or juliovidigal have a quick look for instance?
Good afternoon.
Can not do everything inside the M? To test, instead of using the XML file?
EX..
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
- Jonas17 years ago
Helper I
Thanks for replying juliovidigal .
Yes, I can try to do that. What is the logic behind Character.FromNumber(34)? Is this something from your XML-file, or do you havew to use this in your M in order to make the urls work?
- juliovidigal7 years ago
Advocate I
Inside the Text.ToBinary it plays the role of ".
Mine works with this, you can use it ... even because it's so much better than using the dento call of a file, it's all in the code.- Jonas17 years ago
Helper I
I tried running the API in Postman to see if there could be anything wrong with my M, but I am getting Status code 401 there as well, so I think it is my credentials it is something wrong with. I will try to run it through the provider of the API.
Thanks for your time though juliovidigal , will make sure to try it out as soon as my crediantial problems has been dealt with.