Forum Discussion
How to get data from a SOAP WS with Power BI
Good evening. I used your tips, and they really worked, the formatting was simpler. Thanks for the days. Regarding using the text.format, I really did not understand how to apply this. The idea is to receive this as a parameter? So you do not get stuck in the code? Thank you
Hi check below blog post. It explains concepts of calling any Web service in Power BI. Basically, you need to craft SOAP Body for POST request and need to supply credentials / http headers (e.g. Content-Type, SOAPAction )
https://zappysys.com/blog/call-soap-api-power-bi-read-xml-web-service-data/
Configure ZappySys XML ODBC DSNPreview SOAP API query using ZappySys XML DriverImport SOAP API data in Power BI using ODBC connection
Sample SQL to import SOAP Web Service Data in Power BI
SELECT * FROM $
WITH(
src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
,DataConnectionType='HTTP'
,CredentialType='Basic' --OR SoapWss
,SoapWssPasswordType='PasswordText'
,UserName='myuser'
,Password='pass$$w123'
,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
,ElementsToTreatAsArray='HolidayCode'
,RequestMethod='POST'
,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
,RequestData='
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/">
<soapenv:Header/>
<soapenv:Body>
<hol:GetHolidaysAvailable>
<!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]-->
<hol:countryCode>UnitedStates</hol:countryCode>
</hol:GetHolidaysAvailable>
</soapenv:Body>
</soapenv:Envelope>'
)