Using the wsimport tool from the command line

We used the Ant task wsimport to generate the client JAR file in the generate-client target. We may also use the wsimport tool to generate the client JAR from the command line. First, we need to start the GlassFish Server using the following command:

asadmin start-domain domain1

Domain1 starts successfully as shown in the command output:

Using the wsimport tool from the command line

Next, generate the client JAR file using the wsimport tool with the following options:

Option

Value

Description

-p

hellowsclient

Package name of the client-side classes

-d

C:UsersdvohraDocuments

NetBeansProjectsHelloWSuildclasses

Destination directory of the client JAR

-verbose

 

Output messages about the compiler

-clientjar

HelloWSServiceClient.jar

The client JAR file name

For other command line options refer to the URL http://jax-ws.java.net/nonav/2.2.3/docs/wsimport.html. Run the wsimport command with the options and the WSDL URL:

wsimport -p hellowsclient -verbose -d C:UsersdvohraDocumentsNetBeansProjectsHelloWSuildclasses -clientjar HelloWSServiceClient.jar http://localhost:8080/clientjar/hellows?wsdl

The output from the wsimport command shows that the client JAR HelloWSServiceClient.jar is generated in the build/classes folder:

Using the wsimport tool from the command line
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.166.131