We had a similar problem writing a .Net client with a third-party Java.Net web service, including a byte byte, and the Java service threw an exception.
The third-party SOAP method took one line as an argument, and that line was an XML document (I love people who really donβt understand what problem SOAP is trying to solve!) By default .net added UTF-8 bytes to the XML document " payload, "which is strictly correct, but in practice causes problems.
In our case, we found two possible solutions from the end of the client (.net). I'm not sure how easy SQL Reporting will do it.
String.Trim () - xml should have been placed in a string before going to the soap method by calling .Trim () removed the byte order. Easily.
The second way was to slightly modify the UTF encoding settings in XmlWriterSettings, something like the following:
XmlWriter xmlWriter = null; XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.Encoding = new UTF8Encoding(false); xmlWriter = XmlWriter.Create(xmlSteam, settings);
An important bit is the "new UTF8Encoding ( false ) encoding"; this argument is "encoderShouldEmitUTF8Identifier" and pretty much solves the problem.
source share