Run an unmanaged web services JAX-RPC client
WebSphere Application Server v9.0 and the Application Client for WAS v9.0 provides a thin Java Platform, Standard Edition 6 (Java SE 6) web services client runtime implementation based on the JAX-RPC 1.1 specification. The Thin Client for JAX-RPC with WAS is a stand-alone Java SE 6 client environment that enables running unmanaged JAX-RPC web services client applications in a non-WebSphere environment to invoke web services that are hosted by the application server.
Use the Thin Client for JAX-RPC with WAS as a stand-alone client run time in a pure Java SE environment, or within an OSGi environment. The Thin Client for JAX-RPC is not supported when running within WAS or WebSphere Application Client environments. In this version of the application server, with the exception of the Administration Thin Client, other Thin Client run times provided with the application server can also reside in the CLASSPATH and coexist with the Thin Client for JAX-RPC.
Before we can set up a JAX-RPC unmanaged client environment we will need to obtain the Thin Client for JAX-RPC Java archive (JAR) file. To obtain the Thin Client for JAX-RPC, we must either install the application server or the application client.
The Thin Client for JAX-RPC JAR file, com.ibm.ws.webservices.thinclient_8.5.0.jar, is located in the app_server_root\runtimes directory. Refer to the license agreements to ensure correct usage and for limitations on copies of the Thin Client for JAX-RPC outside of the WebSphere environment.
The Thin Client for JAX-RPC is supported in the following environments:
- IBM SDKs (SDKs) Version 6.0
- Sun Java Development Kit (JDK) Version 6.0 provided by IBM
- non-IBM SDKs v6.0 with this limitation:
- Xerces limitation on non-IBM SDKs
If we are using a non-IBM SDK, because of dependencies with the Xerces implementation, we will need to download Xerces-J version 2.6.2 and set it in the classpath before attempting to run the Thin Client for JAX-RPC.
- Equinox 3.6 OSGi runtime environments
Running web services clients that invoke web services before the application server, in which the client is running, has finished starting is not a supported scenario.
WS-Addressing is not supported for JAX-RPC web services in an unmanaged client environment. To use WS-Addressing, or a web service standard that relies on WS-Addressing, such as WS-Notification, use the Thin Client for Java API for XML-based Web Services (JAX-WS) instead. To learn how to setup and run the Thin Client for JAX-WS, see the Thin Client for JAX-WS documentation.
Tasks
- Configure the path. We can add the Java bin directories to your path by typing:
(Windows) (ZOS)
set PATH=<your_JDK_bin_directory>;%PATH%(AIX) (HPUX) (Solaris) (Linux)
export PATH=<your_JDK_bin_directory>:$PATH- Configure the classpath.
(Windows) (ZOS)
set CLASSPATH=.;<your_web_services_thin_client_install_directory>\com.ibm.ws.webservices.thinclient_8.5.0.jar; <your_application_jars>;%CLASSPATH%(AIX) (HPUX) (Solaris) (Linux) (iSeries)
export CLASSPATH=.:<your_web_services_thin_client_install_directory>/com.ibm.ws.webservices.thinclient_8.5.0.jar: <your_application_jars>;$CLASSPATH
- If we are using a non-IBM SDK, obtain a Xerces xml-apis.jar and xercesImpl.jar from the Xerces web site and configure the classpath definition.
(Windows) (ZOS)
set CLASSPATH=.;<your_Xerces_install_directory>\xml-apis.jar;<your_Xerces_install_directory> \xercesImpl.jar;%CLASSPATH%(AIX) (HPUX) (Solaris) (Linux) (iSeries)
export CLASSPATH=.:<your_Xerces_install_directory>/xml-apis.jar:<your_Xerces_install_directory> \xercesImpl.jar:$CLASSPATH
- Configure SSL for the client.
- Add the following system properties to the Java command:
-Dcom.ibm.SSL.ConfigURL=file:///home/sample/ssl.client.propsWe can obtain the ssl.client.props file from the WAS installation and modify the file to suit the environment. We must, at a minimum, update the location of the com.ibm.ssl.keyStore and com.ibm.ssl.trustStore key files in the ssl.client.props file to the match location of our target environment.
For example, use these SSL configuration settings when running the application with a Sun JRE:com.ibm.ssl.protocol=SSL com.ibm.ssl.trustManager=SunX509 com.ibm.ssl.keyManager=SunX509 com.ibm.ssl.contextProvider=SunJSSE com.ibm.ssl.keyStoreType=JKS com.ibm.ssl.keyStoreProvider=SUN com.ibm.ssl.keyStore=/home/user1/etc/key.jks com.ibm.ssl.trustStoreType=JKS com.ibm.ssl.trustStoreProvider=SUN com.ibm.ssl.trustStore=/home/user1/etc/trust.jksThe key store file and trust store file must be created using the Java keytool utility before the application runs. The automatic key file generation is not supported with a non-IBM product JRE.
- Enter the following command to run the client application:
(Windows) (ZOS)
%JAVA_HOME%/bin/java -Dcom.ibm.SSL.ConfigURL=file:///home/sample/ssl.client.props <your_client_application>(AIX) (HPUX) (Solaris) (Linux) (iSeries)
$JAVA_HOME/bin/java -Dcom.ibm.SSL.ConfigURL=file:///home/sample/ssl.client.props <your_client_application>
We have set up an unmanaged JAX-RPC client runtime environment used to invoke web services hosted on a WAS.
The following command illustrates how to display to version of the thin client that we are running:
java -cp (wasHome)/runtimes/com.ibm.ws.webservices.thinclient_8.5.0.jar com.ibm.ws.webservices.VersionThe following example illustrates the output of the command:
IBM Web services build: cf021412.02 IBM Web services release: 8.5.5 Time stamp: 5/14/14 21:11:46
Task overview: Implementing web services applications Implement JAX-RPC web services clients Running an unmanaged web services JAX-WS client Xerces website Application Client installation information