Well, I checked the output of stringToBytes, and it is indeed already adding the BOM when I use “UnicodeBig” as the encoding. Just to be safe, I also checked the output of “UnicodeLittle” encoding - both match up to what Eduardo listed as the correct values. So that doesn’t appear to be an issue.
Changing the encoding name is a good suggestion, Rob, but it didn’t help. I submitted a test XML document with “UnicodeBig” as the encoding type with the same result as “UTF-16”. In fact, it doesn’t seem to matter what is in the encoding type attribute of the XML header. I don’t think that webMethods is even able to read the XML header, much less determine the encoding from it. Somewhere in the content handler for XML, the server must be converting the incoming stream to a String. It seems that there just isn’t a check for the UTF-16 encoding when that conversion occurs.
By the way, my local machine (with Sun’s 1.3.1 JVM) also fails to receive the UTF-16 encoded XML properly. So this problem doesn’t appear to be JVM related, or at least not related to 1.2 vs. 1.3. I don’t have an easy way to test 1.4.
Skip
#Integration-Server-and-ESB#webMethods#webmethods-Protocol-and-Transport