JAX-RPC Web services |
|
|
![]() |
|
Configure and run | Technotes | Javadoc | Build with Ant |
Configuring the Sample |
Running the Sample |
There are two Stock Quote clients, a Java 2 Standard Edition (J2SE) version and a Java 2 Enterprise Edition (J2EE) container-managed version. If you want the full benefit of J2EE container services run the J2EE version.
To complete the configuration of this Sample, deploy the JAX-RPC Web services Sample application on the server. If the sample application is not already deployed refer to the instructions for Rebuilding and deploying the WebServicesSamples.ear file.
Verify that the server has started before running the clients.
The Stock Quote Sample consists of two clients and a single enterprise bean deployed on the server. One client is a simple J2SE client. You can find it in a program named GetQuote. The other is a Java 2 Enterprise Edition (J2EE) client. You can find it in the GetQuoteClient.jar.
Running the J2SE Stock Quote simple client |
Running the J2EE Stock Quote application client |
The Stock Quote clients query the StockQuote enterprise bean to retrieve current stock quotes from the Web. The StockQuote Web service can return a fixed value or current stock quotes if an Internet connection is available. The first argument to the Stock Quote clients is the target endpoint URL, which specifies the Web service to use. The second argument is the stock symbol. You can use a value of XXX to obtain the fixed price without using an Internet connection.
The J2SE Stock Quote client is not container-managed.
For more general instructions on invoking a J2SE WebSphere client, refer to the topic about developing thin application client code in the Info Center.
To run the J2SE Stock Quote simple client from a WebSphere Application Server,
perform the following steps, based on your operating system:
C:\>"%JAVA_HOME%\bin\java" %WAS_LOGGING% -classpath "%WAS_CLASSPATH%;%WAS_HOME%\samples\lib\WebServicesSamples\simpleClients.jar;%WAS_HOME%\runtimes\com.ibm.ws.webservices.thinclient_7.0.0.jar" samples.stock.GetQuote http://localhost:9080/StockQuote/services/xmltoday-delayed-quotes XXX XXX: 55.25 C:\>"%JAVA_HOME%\bin\java" %WAS_LOGGING% -classpath "%WAS_CLASSPATH%;%WAS_HOME%\samples\lib\WebServicesSamples\simpleClients.jar;%WAS_HOME%\runtimes\com.ibm.ws.webservices.thinclient_7.0.0.jar" samples.stock.GetQuote http://localhost:9080/StockQuote/services/xmltoday-delayed-quotes DELL DELL: 23.67 |
The J2EE application GetQuoteClient.jar is a container managed version of the Stock Quote client.
In the following steps, the variable install_root refers to the WebSphere installation root.
To run the J2EE application Stock Quote client from a WebSphere Application Server,
perform the following steps, based on your operating system:
C:\WebSphere\AppServer\samples>\WebSphere\AppServer\bin\launchClient \WebSphere\AppServer\samples\lib\WebServicesSamples\ApplicationClients.ear -CCjar=GetQuoteClient.jar IBM IBM WebSphere Application Server, Release 7.0 J2EE Application Client Tool Copyright IBM Corp., 1997-2008 WSCL0012I: Processing command line arguments. WSCL0013I: Initializing the J2EE Application Client Environment. [3/29/06 14:55:22:359 CST] 0000000a W UOW=null source=com.ibm.ws.ssl.config.SSLConfig org=IBM prod=WebSphere component=Application Server thread=[P=720609:O=0:CT] CWPKI0041W: One or more key stores are using the default password. WSCL0035I: Initialization of the J2EE Application Client Environment has completed. WSCL0014I: Invoking the Application Client class com.ibm.websphere.samples.webservices.stockClient.GetQuote IBM: 83.36 C:\WebSphere\AppServer\samples>\WebSphere\AppServer\bin\launchClient \WebSphere\AppServer\samples\lib\WebServicesSamples\ApplicationClients.ear -CCjar=GetQuoteClient.jar XXX IBM WebSphere Application Server, Release 7.0 J2EE Application Client Tool Copyright IBM Corp., 1997-2008 WSCL0012I: Processing command line arguments. WSCL0013I: Initializing the J2EE Application Client Environment. [3/29/06 15:00:04:062 CST] 0000000a W UOW=null source=com.ibm.ws.ssl.config.SSLConfig org=IBM prod=WebSphere component=Application Server thread=[P=2171:O=0:CT] CWPKI0041W: One or more key stores are using the default password. WSCL0035I: Initialization of the J2EE Application Client Environment has completed. WSCL0014I: Invoking the Application Client class com.ibm.websphere.samples.webservices.stockClient.GetQuote XXX: 55.25 |
You can learn more about how the client and the application work by referring to the Stock Quote tech notes and viewing the Java source code.