Troubleshooting
Problem
When creating a Web Service in RAD (i.e JAX-WS) on Windows, the user may encounter one of the following errors:
The wsgen tool returned an error:
The command line is too long. The wsgen tool returned an error:
The syntax of the command line is incorrect.These errors do not occur when running RAD on Linux.
Cause
RAD invokes a wsgen.exe command. Windows has a 32,767 character command line limit. If trying to execute the process from within cmd.exe, that limit is 8,191 characters. If the command line exceeds the command line limit, the user will encounter the error in RAD.
Resolving The Problem
To workaround the issue:
- Put a .options file in the RAD install directory with the following contents:
- com.ibm.ast.ws.jaxws.emitter/debug=true
- Update eclipse.ini to specify jdk/jre/bin/java.exe instead of specifying javaw.exe.
- Create a RAD shortcut: E:\RAD_9.7.0.3\eclipse.exe -consolelog -debug .options
- Add the User Library to the JAX-WS Project's Java Build Path.
- Right click JAX-WS Project's Impl.java (for example).
- Select WebServices > Create Web Service > Bottom Up Approach.
- If you encounter the error, proceed to the next step.
- Create a WSGenCommandLineProject (for example, by selecting File > New > Project). Create a .bat file in that project called wsgenCommand.bat (for example).
- Copy the failing command from the command prompt window generated by RAD's Web Services wizard, remove "arg:"and put the command on one line in the wsgenCommand.bat file.
- Highlight the wsgenCommand.bat file and click RunAs Configuration icon > External Tools Configuration and specify the following:
- Name: WSGen Command Line Configuration
- Location: E:\RAD_9.7.0.3\jdk\bin\wsgen.exe
Arguments; -cp E:/Workspaces/RAD_9.7.0.3_workspace_03_19_2021a/WebOS_BottomUp/WebContent/WEB-INF/classes;..<user directory jars>......os.ws.OSImpl -d E:\Workspaces\RAD_9.7.0.3_workspace_03_19_2021a\.metadata\.plugins\org.eclipse.core.resources\.projects\WebOS_BottomUp\com.ibm.ast.ws.jaxws.emitter\TEMP2743849390246192543 -s E:\Workspaces\RAD_9.7.0.3_workspace_03_19_2021a\.metadata\.plugins\org.eclipse.core.resources\.projects\WebOS_BottomUp\com.ibm.ast.ws.jaxws.emitter\TEMP2743849390246192543 -keep -verbose -servicename {[http://ws.os/]}
OSImplService -portname {http://ws.os/} OSImplPort -wsdl
- Click Run.
- The resulting wsdl and wsd files should be generated in the following directory (as an example based upon the directory in the wsgen command):
- E:\Workspaces\RAD_9.7.0.3_workspace_03_19_2021a\.metadata\.plugins\org.eclipse.core.resources\.projects\WebOS_BottomUp\com.ibm.ast.ws.jaxws.emitter\TEMP2743849390246192543
Note: If the wsgen.exe is run outside of RAD, run it in Windows PowerShell, making sure to use the wsgen.exe in <RAD installation location>\JDK\bin\wsgen.exe.
Document Location
Worldwide
[{"Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"ARM Category":[{"code":"a8m0z000000bm08AAA","label":"Rational Application Developer"}],"ARM Case Number":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"9.7.0"}]
Was this topic helpful?
Document Information
Modified date:
10 March 2026
UID
ibm16438021