By default the XmlMessageConverter GetXmlString will generate UTF8 preamble and include it in a message posted to Tibco.
For some scenarios system on the other side (especially Java) doesn't expect preamble (chars 239,187,191).
It gets there because the accessing Encoding.UTF8 returns an instance of UTF8 encoder that will create BOM (Byte Order Mark)
(For the Encoding.UTF8 the constructor of UTF8Encodingr is called with encoderShouldEmitUTF8Identifier set to true, while teh default one is false).
I think that for simple XmlMessageConverter it would be easier to just have a static encoder on class level.
Should also benefit performance, as there is no need to create new instance of envoder for each conversion helpers (
UTF8ByteArrayToString and StringToUTF8ByteArray).
Another topic - there is probably a reason for that, but way the XmlTextWriter and MemoryStream doesn't follow the 'using pattern'?