Attempts to generate JAX-RPC WebServices from a WSDL file that contain non-ASCII characters result in an "Invalid Character" compilation errors shown in IBM Rational Business Developer.
The following steps reproduce the problem:
- Develop a WSDL file that contains non ASCII characters (for example, diacritic characters used in the Danish language)
- Develop a JAX-RPC WebService from this WSDL, targeting IBM WebSphere Application Server v7 or higher
- Open the files with the Java editor in Rational Business Developer and you will find that the diacritic characters do not show correctly:
and there are compilation errors for each such diacritic character:
Syntax error on token "Invalid Character",, expected
Starting with IBM WebSphere Application Server v7, JAX-RPC WebServices files are generated with fixed UTF-8 encoding. In previous versions of WebSphere Application Server, the encoding was not specified and therefore the default platform encoding was used.
- Windows Operating System, with English locale
- Rational Business Developer was set to use the default encoding for this environment, namely Cp125
Diagnosing the problem
- Compile the generated files with a command-line compiler such as
javac. You will see that they do not produce any compilation errors in this case.
- Regenerate the same WebService targeting IBM WebSphere Application Server v6.1, if available
- Notice that the files emitted by WebSphere Application Server v6.1 also compile correctly in Rational Business Developer
- Compare the corresponding files generated when targeting WebSphere Application Server v6.1 and WebSphere Application Server v7 with a hexadecimal editor. Notice that the diacritic characters are represented differently in the corresponding files.
Resolving the problem
You must use UTF-8 encoding in Rational Business Developer to read the WebServices files generated when targeting WebSphere Application Server v7 and higher.
You can change the encoding at the following levels:
- Workspace (Window > Preferences > General > Workspace > Text File Encoding)
- Project (Properties > Resource > Text File encoding)
- Folder (Properties > Resource > Text File encoding)
- File (Properties > Resource > Text File encoding)
If you use the settings at folder/file level, you can use UTF-8 for the WebServices generated files, and continue to use the previous encoding for all the other files.
|Software Development||Rational Application Developer for WebSphere Software||Web Services Development||Linux, Windows||7.5, 7.5.1, 7.5.2, 7.5.3, 7.5.4, 7.5.5, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 8.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 126.96.36.199, 188.8.131.52, 8.5, 8.5.1|
|Software Development||Rational Software Architect for WebSphere Software||Web Services Development||Linux, Windows||7.5, 7.5.1, 7.5.2, 7.5.3, 7.5.4, 7.5.5, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 8.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 188.8.131.52, 184.108.40.206, 8.5, 8.5.1|
|Software Development||Rational Software Architect Extension for SOA and WebSphere||Linux, Windows||7.5, 8.0, 8.0.2, 8.0.4, 8.5|