I try get a response from a wsdl WebService and use therefore Web.Contents https://docs.microsoft.com/en-us/powerquery-m/web-contents in Power Query and need to post optional xml-content.
In my first Use-Case I included a local xml-file with File.Contents https://docs.microsoft.com/en-us/powerquery-m/file-contents to post it to the Service. This works very well.
=Xml.Tables(Web.Contents("http://10.3.3.33:18080/WebService?wsdl",
[Content=File.Contents("E:\input.xml"),Headers=[#"Accept-
Encoding"="gzip,deflate", SOAPAction="", #"Content-
Type"="text/xml;charset=UTF-8"]]))
In my seconde Use-Case I need to use the same Content of the xml-file out of a cell. With Text.FromBinary https://docs.microsoft.com/en-us/powerquery-m/text-frombinary I load the content to a new column called [XML_TEXT]. Edit it and convert it to a Binary with Text.ToBinary in a column called [Binary] in Power Query.
I do not know how to post [XML_TEXT] or [Binary] to the webservice!
= Table.AddColumn(PreviousStep, "UserDefined", each
Xml.Tables(Web.Contents("http://10.3.3.33:18080/WebService?wsdl",
[Content=[Binary],Headers=[#"Accept-Encoding"="gzip,deflate",
SOAPAction="", #"Content-Type"="text/xml;charset=UTF-8"]])))
I expect to get a XML back as in Use Case One. But I receive the following message:
DataSource.Error: Fehler beim Abrufen von Inhalten von
"http://10.3.3.33:18080/WebService?wsdl" (500) durch "Web.Contents":
Internal Server Error
Details:
DataSourceKind=Web
DataSourcePath=http://10.3.3.33:18080/WebService
Url=http://10.3.3.33:18080/WebService?wsdl
Problem solved.
There was an Error in [XML_TEXT] with was passed in Use Case Two to the WebService.
By converting from Float to String, "," was to be converted to "."
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.