Book Image

Java 7 JAX-WS Web Services

By : Deepak Vohra
Book Image

Java 7 JAX-WS Web Services

By: Deepak Vohra

Overview of this book

<p>Web services are applications that use open, XML-based standards and transport protocols to exchange data with clients. <br /><br />In the book Developing a JAX-WS Web Service using the wsimport clientjar Option, we shall create a JAX-WS web service with Java 7. We shall discuss the new clientjar option in the wsimport tool or the wsimport ant task which is used to generate JAX-WS portable artifacts from a service wsdl. Subsequently, we use the web service artifacts to invoke the web service from a web service client.</p>
Table of Contents (8 chapters)

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:

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:\Users\dvohra\Documents\

NetBeansProjects\HelloWS\build\classes

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