Thanks for all your replies. Rob, you were right on track with the JVM comment. My server is still running 1.2.2 JVM, which requires an encoding name of “UnicodeBig” (or “UnicodeLittle”, if you want little-endian) instead of “UTF-16”. Once I’d done that, the string was properly encoded by using the stringToBytes function. So I was able to get the sending of an UTF-16 encoded XML file working properly.
I ran into another problem immediately after that - webMethods doesn’t appear to properly recognize incoming UTF-16 encoded XML. I set up a simple service that receives an XML document over HTTP, and was able to receive the document fine when using the standard (UTF-8) encoding. UTF-16 documents, though, came through as blank - they were recognized as XML, but with no elements. Obviously this is useless, so I ended up changing my submission to use Content-Type “text/html” so that the webMethods parser wouldn’t automatically convert to XML, then converting the InputStream myself using the proper encoding. Does that sound like the right approach, or is there a way to make the webMethods XML content-handler recognize a document that uses UTF-16 encoding?
Thanks,
Skip