| Sun Java System Application Server |
This sample application provides an example of a Web Service for Java Enterprise Edition (J2EE). This sample is similar to the JAX-RPC Simple sample application, except the client invokes methods with arguments of non-primitive types.
The J2EE application client HelloClient makes a remote
call to the demoArray() method of the HelloWorld web service.
The web service takes String Array as input and returns reversed String Array.
The HelloClient also makes a remote call to the demoBean() method of the HelloWorld
web service. The web service takes the SimpleAccountBean object as input, and returns
the new BigDecimal account balance by calculating interest.
The general instructions for building, deploying, and running sample applications are provided in Building, Deploying, and Running Sample Applications. In reading this document, use the following application-specific variables for this application:
install_dir is the directory where Application Server is installed.
app_dir is the application base directory: install_dir/samples/webservices/jaxrpc/apps/simplebean.
jaxrpc-simplebean.ear.
Follow this general procedure:
build.xml, is in the app_dir
directory, specifically, install_dir/samples/webservices/jaxrpc/apps/simplebean.
install_dir/samples/webservices/jaxrpc/apps/simplebean/jaxrpc-simplebean.ear.
To run the application, follow these steps:
app_dir
install_dir/bin/appclient -client jaxrpc-simplebeanClient.jar.
The program uses the retrieved client stubs to display the following lines:
demoArray method: it was a dark and stormy night night stormy and dark a was it demoBean method: SimpleAccountBean: setting balance to 1200.00 SimpleAccountBean: setting customerName to Duke newBalance: 1260.0000 SimpleAccountBean: setting balance to 1260.0000
When you run the client, if you see the error Connection refused, make certain that the
soap:address setting in
app_dir/simplebean-war/src/conf/HelloWorld.wsdl
is set to http://hostname:instance-portjaxrpc-simplebean/simplebean.
If you need to modify the file, execute asant core before running the sample again.
Copyright © 2006 Sun Microsystems, Inc. All rights reserved.