background image

Deploying the ServiceUsing Ant

<< Coding the Service Endpoint | Testing the Service without a Client >>
<< Coding the Service Endpoint | Testing the Service without a Client >>

Deploying the ServiceUsing Ant

2. In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/jaxws/.
3. Select the helloservice folder.
4. Select the Open as Main Project check box.
5. Click Open Project Folder.
6. In the Projects tab, right-click the helloservice project and select Deploy Project.
This builds and packages to application into helloservice.war, located in
tut-install/javaeetutorial5/examples/jaxws/helloservice/dist/, and deploys this WAR
file to your Application Server instance.
Building, Packaging, and Deploying the Service Using Ant
To build and package helloservice using Ant, in a terminal window, go to the
tut-install/javaeetutorial5/examples/jaxws/helloservice/ directory and type the
following:
ant
This command calls the default target, which builds and packages the application into an
WAR file, helloservice.war, located in the dist directory.
To deploy the helloservice example, follow these steps:
1. In a terminal window, go to
tut-install/javaeetutorial5/examples/jaxws/helloservice/.
2. Make sure the Application Server is started.
3. Run ant deploy.
You can view the WSDL file of the deployed service by requesting the URL
http://localhost:8080/helloservice/hello?WSDL
in a web browser. Now you are ready to
create a client that accesses this service.
Undeploying the Service
At this point in the tutorial, do not undeploy the service. When you are finished with this
example, you can undeploy the service by typing this command:
ant undeploy
The all Task
As a convenience, the all task will build, package, and deploy the application. To do this, enter
the following command:
ant all
Creating a Simple Web Service and Client with JAX-WS
Chapter 16 · Building Web Services with JAX-WS
483