Hi,

I'm using a "wsdl2java"-generated CXF Client to talk to a .NET Webservice. When sending a string containing some special characters (german "umlaute" in my case), these characters seem to be "mangled up" by some CXF component. For example, I have this "hardcoded" string in my (UTF-8 encoded) Java source file:

[...]
request.setToken("ä ö ü Ä Ö Ü ß");
[...]

When sending this request, CXF creates the following HTTP POST request:

[...]
POST /MyRESWebServiceV1_0.asmx HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://webservices.hotel.de/MyRES/V1_0/ GetMaintainableProperties"
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.5.0_07
Host: 127.0.0.1:8080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 626

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/ envelope/"><soap:Body><GetMaintainableProperties xmlns="http:// webservices.hotel.de/MyRES/ V1_0"><objRequest><WebServiceConsumerID>18</ WebServiceConsumerID><WebServiceConsumerPassword>XXXXX</ WebServiceConsumerPassword><Token>ä ö ü Ä Ö Ü ß</Token><CustomerNumberHotelde>0</ CustomerNumberHotelde><CustomerEmailHotelde>[EMAIL PROTECTED]</ CustomerEmailHotelde><CustomerPasswordHotelde> XXXXX </ CustomerPasswordHotelde></objRequest></GetMaintainableProperties></ soap:Body></soap:Envelope>
[...]

As you can see, the string is mangled into "<Token>ä ö ü Ä Ö Ü ß</Token>". Strings without special characters are transferred correctly. This looks like some very weird Unicode character encoding problem to me. Even more strangely, it seems to work when I encode my source file as ASCII under Linux, but not when I encode the same source file as ASCII under Mac OS X, which is my main development plattform. I'm totally puzzled by this behaviour and would appreciate any helping remarks.

I tried both CXF 2.0 and CXF 2.1 (incubator-20070628.012602-1), with equal results.


Thank you in advance and best regards,

Oliver


--
Oliver Flasch
[EMAIL PROTECTED]


Reply via email to