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
>/jwstutorial13/examples/cb/
. Within thecb
directory are subdirectories for each Web application--saaj
,jaxrpc
,server
--and a directory,common
, for classes shared by the Web applications. Each subdirectory contains abuild.xml
andbuild.properties
file. The Web application subdirectories in turn contain asrc
subdirectory for Java classes and aweb
subdirectory for Web resources and the Web application deployment descriptor.Setting the Port
Several files in the Coffee Break depend on the port that you specified when you installed the Java WSDP. The tutorial examples assume that the server runs on the default port, 8080. If you have changed the port, you must update the port number in the following files before building and running the examples:
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 install the JAX-RPC service:
- In a terminal window, go to
<INSTALL>
/jwstutorial13/examples/cb/jaxrpc/
.- Run
ant
build
. 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 registers the service with the Registry Server and installs it into Tomcat. 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>
/jwstutorial13/examples/common/build.properties
as described in Building the Examples.- Run
ant
build-client
. This task creates the JAR file that contains the classes needed by JAX-RPC clients. Thebuild-client
task runswscompile
to 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-price
Here is what you should see when you run
ant
run-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.00Building and Installingthe SAAJ Service
To build the SAAJ service and client library and install the SAAJ service:
- In a terminal window, go to
<
INSTALL
>/jwstutorial13/examples/cb/saaj/
.- Run
ant
build
. This task creates the client library and compiles the server classes into the correct location for installation.- Make sure Tomcat is started.
- Run
ant install
.- Test that the SAAJ service has been installed correctly by running one or both of the test programs:
ant
run-test-price
antrun-test-order
Here is what you should see when you run
ant
run-test-price
:TBD
Building and Installingthe Coffee Break Server
To build and install the Coffee Break server:
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/html
in a browser and entering your username and password in the dialog that appears. You will see/cbserver
,/jaxrpc-coffee-supplier
, and/saaj-coffee-supplier
in 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
build
anddist
directories, runant
clean
in each directory, including<
INSTALL
>/jwstutorial13/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.