After a runtime upgrade, JAX-RPC WebServices files show an "Invalid Character" compilation error

Technote (troubleshooting)


Problem(Abstract)

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.

Symptom

The following steps reproduce the problem:

  1. Develop a WSDL file that contains non ASCII characters (for example, diacritic characters used in the Danish language)

  2. Develop a JAX-RPC WebService from this WSDL, targeting IBM WebSphere Application Server v7 or higher

  3. 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


Cause

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.

Environment

  • Windows Operating System, with English locale
  • Rational Business Developer was set to use the default encoding for this environment, namely Cp125

Diagnosing the problem

  1. 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.

  2. Regenerate the same WebService targeting IBM WebSphere Application Server v6.1, if available

  3. Notice that the files emitted by WebSphere Application Server v6.1 also compile correctly in Rational Business Developer

  4. 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

SOLUTION


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:

  1. Workspace (Window > Preferences > General > Workspace > Text File Encoding)

  2. Project (Properties > Resource > Text File encoding)

  3. Folder (Properties > Resource > Text File encoding)

  4. 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.

Cross reference information
Segment Product Component Platform Version Edition
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, 7.5.5.1, 7.5.5.2, 7.5.5.3, 7.5.5.4, 7.5.5.5, 8.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.4.1, 8.0.4.2, 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, 7.5.5.1, 7.5.5.2, 7.5.5.3, 7.5.5.4, 7.5.5.5, 8.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.4.1, 8.0.4.2, 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

Rate this page:

(0 users)Average rating

Document information


More support for:

Rational Business Developer
Web Services

Software version:

7.5, 7.5.1, 7.5.1.1, 7.5.1.2, 7.5.1.3, 7.5.1.4, 7.5.1.5, 7.5.1.6, 7.5.1.7, 7.5.1.8, 8.0.1, 8.0.1.1, 8.0.1.2, 8.0.1.3, 8.0.1.4, 8.0.1.5, 8.5, 8.5.1

Operating system(s):

Linux, Windows

Reference #:

1637620

Modified date:

2013-06-24

Translate my page

Machine Translation

Content navigation