Skip to main content

.NET-to-Java interop issue when using SOAP/TCP

2 replies [Last post]
Joined: 2006-07-13

We have discovered the following issue while doing .NET-to-Java communications using SOAP/TCP as the transport. The Noemax SOAP/TCP implementation included in WCF-Xtensions was used on the .NET CF side.

This is what happens:

- While negotiating the session, the .NET CF client sends to GlassFish an initSession request message encoded as text XML over SOAP/TCP.

- The Java server replies with an initSessionResponse message which is also encoded as text XML. However, the TextMessageEncoder component of .NET refuses to accept this message and throws the following System.ServiceModel.CommunicationException: "An XML declaration with an encoding is required for all non-UTF8 documents."

The declaration at the beginning of the response message sent by the Java side is <?xml version="1.0" ?>. It seems that the text message encoding implementation of .NET CF requires an explicit declaration of the charset encoding. Simply changing this string to <?xml version="1.0" encoding="utf-8" ?> fixes the issue.

IMO this is a general interoperability problem between Java and .NET CF.

Please note that there is no such problem when SOAP/TCP is used as the transport between desktop .NET (i.e. non-compact framework) and Java, this problem only arises with the text message encoding implementation of .NET CF 3.5.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-01-25

So basically how to say Metro or JAX-WS RI to send encoding with the WebService response:

instead of

Is there any solution?

Joined: 2003-06-14

I don't think we have an option to turn the preamble on.