问题
I have generated a bunch of java-files from a WSDL source. I used Apache CXF 2.6.1 for generating the files.
When I put the code onto our production box that is running jetty and maven and I send a request to the server via the generated java-files it somehow changes the systems/JVM character encoding. The swedish characters å, ä and ö changes into Ã¥, ä, ö.
I can't reproduce this on my own box.
Someone have any idea?
回答1:
Since version 2.5.4 there is a new command line option -encoding which is not yet documented on the official documentation. But when you call the tool with the help option (-h|-help) you will see the encoding option:
wsdl2java ... -encoding UTF-8 ....
来源:https://stackoverflow.com/questions/12180231/wsdl2java-generated-code-causes-character-encoding-problems