# clean the environment: ======================== # the original WSDL-file, is encoded as UTF-8: application/xml; charset=utf-8 # and its encoding is declared in the XML encoding-line: ... wsimport version "2.2.9" # set the encoding to UTF-8 =========================== parsing WSDL... Downloading the WSDL and associated metadata Generating code... Compiling code... Archiving the generated artifacts into destdirUTF8/HelloWorldClient.jar. Archive: destdirUTF8/HelloWorldClient.jar inflating: META-INF/wsdl/HelloWorld.wsdl # the encoding of the WSDL-file in the generated client is: text/plain; charset=utf-8 # but in this generated WSDL-File, there is no line with an XML-declaration (with an encoding): These are also german umlaute: äöü ... # run this webservice-client within UTF-8: ========================================= # the webservice-client is initializted with the default-charset: UTF-8 # SUCCESS: successfully created webservice client: ch.postfinance.example.helloworld.HelloService@5a07e868 # set the encoding to ISO-8895-1 ================================ parsing WSDL... Downloading the WSDL and associated metadata Generating code... Compiling code... Archiving the generated artifacts into destdirISO/HelloWorldClient.jar. Archive: destdirISO/HelloWorldClient.jar inflating: META-INF/wsdl/HelloWorld.wsdl # the encoding of the WSDL-file in the generated client is: text/plain; charset=iso-8859-1 # but in this generated WSDL-File, there is no line with an XML-declaration (with an encoding): These are also german umlaute: äöü ... # so this wsdl (that must also follow all rules from an xml-file) is an invalid xml-file. # run this ISO-8859-1 webservice-client: (will fail) ============================================== # the webservice-client is initializted with the default-charset: UTF-8 # FAILED unable to create the webservice client: com.sun.xml.internal.ws.streaming.XMLStreamReaderException: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,205] Message: Invalid byte 2 of 3-byte UTF-8 sequence. # the webservice-client will fail again, even when running with ISO-8859-1 default-character encoding ============================================== # the webservice-client is initializted with the default-charset: ISO-8859-1 # FAILED unable to create the webservice client: com.sun.xml.internal.ws.streaming.XMLStreamReaderException: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,205] Message: Invalid byte 2 of 3-byte UTF-8 sequence.