| Sun Java System Application Server |
The JAX-RPC Simple application provides an example of a simple web service based on the Web Services for Java 2 Enterprise Edition (J2EE) version 1.1. The sample application includes a web service named HelloWorld and an application client named HelloClient. The figure below shows an overview of this application.
In the server application,
the HelloIF Service Endpoint interface is implemented by the
HelloImpl Service Implementation Bean.
This interface defines the sayHello() method of the HelloWorld web service.
Before the first request, the application creates a service instance, the
HelloIFPort port component.
In the client container,
the HelloClient application client uses JNDI lookup to access the HelloWorld
Service object, gets access to HelloIFPort, and invokes the sayHello() method,
which accepts a string parameter and returns a string.
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/simple.
jaxrpc-simple.ear.
Follow this general procedure:
build.xml, is in the app_dir
directory, specifically, install_dir/samples/webservices/jaxrpc/apps/simple.
install_dir/samples/webservices/jaxrpc/apps/simple
/jaxrpc-simpleClient.jar.
app_dir
install_dir/bin/appclient -client jaxrpc-simpleClient.jar.
The program uses the retrieved client stubs to display the following:
Hello Duke!
When you run the client, if you see the error Connection refused, make certain that the
soap:address setting in
app_dir/simple-war/src/conf/HelloWorld.wsdl
is set to http://hostname:instance-port/jaxrpc-simple/simple.
If you need to modify the file, execute asant core before running the sample again.
Copyright © 2006 Sun Microsystems, Inc. All rights reserved.