I assume that the wsdl is already present and this tutorial is to show, how to use eclipse to generate the java code.
Configuration:
Eclipse 3.3
JAX-WS RI 2.1.5
JDK 6
Step 1: Download the JAX-WS RI jar(JAXWS2.1.5-20081030.jar) from https://jax-ws.dev.java.net/2.1.5/
Step 2: Run the command java -jar JAXWS2.1.5-20081030.jar, Accept the license and allow it to be installed. I will call this $JAXWS_HOME
Step 3: Open eclipse, and Run->External Tools->Open External Tools Dialogue..
Step 4: Give name as GenerateJavaFromWSDL, Location as $JAXWS_HOME\bin\wsimport.bat, Working Directory(path to directory containing wsdl) as ${project_loc}/WEB-INF/wsdl where ${project_loc} [Eclipse variable already defined in eclipse, no need to create this ]is the project location in eclipse, arguments as "myWSDL.wsdl -keep -d ${project_loc}/WEB-INF/src" [without quotes] where myWSDL.wsdl is the wsdl to generate java code, keep is to keep the generated java files and d is the output directory. You can also provide p as argument to specify the package for the java files being generated.
Step 5: Click the Run button. The java files are generated.
Thanks buddy, you finally nailed it for me.
ReplyDeleteThanks, it is really helpful one...
ReplyDelete