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)

Creating an Apache Ant build file


We shall build the web service using an Apache Ant build.xml file. To learn more about Apache Ant and creating build files refer to the URL http://ant.apache.org/. Create a build.xml file in the project root directory. Select File | New File. In New File select Categories as Other and File Types as Ant Build Script, and click on Next:

In the Name and Location window, click on the Browse button for Folder. In the Browse Folders window, select the project root folder HelloWS, and click on Select Folder:

In Name and Location, specify the File Name as build, Project as HelloWS, and click on Finish:

A build.xml file gets added to the HelloWS folder:

The build.xml file is used to compile, package, and deploy the web service to the GlassFish Server, use the -clientjar option to generate a JAR file for the web service portable artifacts and WSDLs, compile the client class, and run the client. In the build.xml file, add property elements for the properties listed...