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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
surfersamu
Helper II
Helper II

Unsupported Media error XML response

I'm trying to send a SOAP request to get XML data from a REST API. 

 

I tested the request on SOAP UI and also with PHP and it is working. The API needs a token and customer key to get a response from the API. When I do it on Power Query I get this error:

 

DataSource.Error: Web.Contents failed to get contents from 'https://service4.ultipro.com/services/EmployeePerson' (415): Unsupported Media Type
Details:
    DataSourceKind=Web
    DataSourcePath=https://service4.ultipro.com/services/EmployeePerson
    Url=https://service4.ultipro.com/services/EmployeePerson

I think is something with the syntax. This is my code for the request:

 

 

let
    Source = Xml.Tables(Web.Contents("https://service4.ultipro.com/services/EmployeePerson"
    ,[Content=Text.ToBinary("<s:Envelope xmlns:a='http://www.w3.org/2005/08/addressing' xmlns:s='http://www.w3.org/2003/05/soap-envelope'>
  <s:Header>
  <a:Action s:mustUnderstand='1'>http://www.ultipro.com/services/employeeperson/IEmployeePerson/FindPeople</a:Action> 
  <UltiProToken xmlns='http://www.ultimatesoftware.com/foundation/authentication/ultiprotoken'>6fsdfdsfsdf54acdsfsdfdsfsdf6</UltiProToken> 
  <ClientAccessKey xmlns='http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey"&Character.FromNumber(34)&">ABCDE</ClientAccessKey> 
  </s:Header>
  <s:Body>
  <FindPeople xmlns='http://www.ultipro.com/services/employeeperson'>
  <query xmlns:b='http://www.ultipro.com/contracts' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
  <b:EmployeeNumber /> 
  <b:FirstName> 
  <b:FormerName /> 
  <b:FullOrPartTime /> 
  <b:Job /> 
  <b:LastHire /> 
  <b:LastName /> 
  <b:Location /> 
  <b:OriginalHire /> 
  <b:PageNumber /> 
  <b:PageSize /> 
  <b:PayGroup /> 
  <b:SupervisorLastName /> 
  <b:TerminationDate /> 
  <b:TimeClockId /> 
  </query>
  </FindPeople>
  </s:Body>
  </s:Envelope>"),Headers=[#"Accept-Encoding"="gzip,deflate", #"Accept"="Basic fsdfdsfdsfdsMjAxNyE=", #"Content-Type"="text/xml;charset=UTF-8"]]
)),
    Table1 = Source{1}[Table],
    Table0 = Table1{0}[Table],
    Table2 = Table0{0}[Table],
    Table3 = Table2{0}[Table],
    Table4 = Table3{0}[Table],
    Table5 = Table4{1}[Table],
    Table6 = Table5{0}[Table],
    #"Changed Type" = Table.TransformColumnTypes(Table6,{{"CompanyCode", type text}, {"EmployeeNumber", Int64.Type}, {"FirstName", type text}, {"LastName", type text}})
in
    #"Changed Type"

I tried switching text/xml to application/xml and got same error.

According to this website: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415

The error is hapenning because the server refuses to accept the request because the payload format is in an unsupported format.

 

But I already have a header for xml. Maybe I have to code this differently because the request to the service needs to include a token and customer key?

 

Or https://service4.ultipro.com/services/EmployeePerson is not compatible with power query?

 

Thank you in advance

 

1 ACCEPTED SOLUTION
surfersamu
Helper II
Helper II

I solved my problem!!

 

This was the correct header I used:  #"Content-Type"="application/soap+xml;charset=UTF-8"

 

I also changed "&Character.FromNumber(34)&" to "". 

 

🙂 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Im trying to connect this api but appear an error in the table

 

1.png

 

answer for power bi2.png

surfersamu
Helper II
Helper II

I solved my problem!!

 

This was the correct header I used:  #"Content-Type"="application/soap+xml;charset=UTF-8"

 

I also changed "&Character.FromNumber(34)&" to "". 

 

🙂 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors