|
Download
FAQ History |
|
API
Search Feedback |
Building, Installing, and Running the Application
The source code for the Coffee Break application is located in the directory
<INSTALL>/jwstutorial12/examples/cb. Within thecbdirectory are subdirectories for each Web application--saaj,jaxrpc,server--and a directory,common, for classes shared by the Web applications. Each subdirectory contains abuild.xmlandbuild.propertiesfile. The Web application subdirectories in turn contain asrcsubdirectory for Java classes and awebsubdirectory for Web resources and the Web application deployment descriptor.Building the Common Classes
To build the common classes:
Building and Installing the JAX-RPC Service
To build the JAX-RPC service and client library and to install the JAX-RPC service:
- In a terminal window, go to
<INSTALL>/jwstutorial12/examples/cb/jaxrpc.- Run
antbuild. This task creates the WAR file of the JAX-RPC service and the JAR file containing the JAXR routines.- Start Tomcat.
- Run ant
set-up-service. This task installs (deploys) the JAX-RPC service into Tomcat and registers the service with the Registry Server. The registration process can take some time, so wait until you see output like the following before proceeding to the next step:
run-jaxr-publish:
[echo] Running OrgPublisher.
[java] Created connection to registry
[java] Got registry service, query manager, and life cycle manager
[java] Established security credentials
[java] Organization saved
[java] Organization key is edeed14d-5eed-eed1-31c2-aa789a472fe0If you get an error, make sure you edited the file
<INSTALL>/jwstutorial12/examples/common/build.propertiesas described in Building the Examples.- Run
antbuild-client. This task creates the JAR file that contains the classes needed by JAX-RPC clients. Thebuild-clienttask runswscompileto generate the stubs and JavaBeans components.- Test that the JAX-RPC service has been installed correctly by running the test programs:
ant run-test-order
antrun-test-priceHere is what you should see when you run
antrun-test-price:
run-test-price:
run-test-client:
[java] 07/21/03 08/20/03
[java] Kona 6.50
[java] French Roast 5.00
[java] Wake Up Call 5.50
[java] Mocca 4.00Later on, you may remove the JAX-RPC service by running
anttake-down-service. This command deletes the service from the Registry Server and undeploys the service from Tomcat. Do not remove the service at this time.Building and Installing the SAAJ Service
To build the SAAJ service and client library and install the SAAJ service:
- In a terminal window, go to
<INSTALL>/jwstutorial12/examples/cb/saaj.- Run
ant build. This task creates the client library and compiles the server classes and copies them into the correct location for installation.- Make sure Tomcat is started.
- Run
ant install.- You can test that the SAAJ service has been installed correctly by running one or both of the test programs: execute
antrun-test-priceorantrun-test-order.Building and Installing the Coffee Break Server
To build and install the Coffee Break server:
- In a terminal window, go to
<INSTALL>/jwstutorial12/examples/cb/server.- Run
antbuild. This task compiles the server classes and copies the classes, JSP pages, client libraries, and tag libraries into the correct location for packaging. Note that the Coffee Break server depends on the client libraries generated by the JAX-RPC (jaxrpc-client.jar) and SAAJ (saaj-client.jar) build process.- Make sure Tomcat is started.
- Run
antinstall.Running the Coffee Break Client
After you have installed all the Web applications, check that all the applications are running by opening the URL
http://localhost:8080/manager/htmlin a browser and entering your username and password in the dialog that appears. You will see/cbserver,/jaxrpc-coffee-supplier, and/saaj-coffee-supplierin the list of applications.Then, to run the Coffee Break client, open the Coffee Break server URL in a Web browser:
You should see a page something like the one shown in Figure 25-2.
![]()
After you have gone through the application screens, you will get an order confirmation that looks like the one shown in Figure 25-3.
![]()
Figure 25-3 Order Confirmation
Removing the Coffee Break Application
To remove the Coffee Break application, perform the following steps:
If you want to remove the
buildanddistdirectories, runant cleanin each directory, including<INSTALL>/jwstutorial12/examples/cb/common.
|
Download
FAQ History |
|
API
Search Feedback |
All of the material in The Java(TM) Web Services Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.