Run an unmanaged web services JAX-WS client
WebSphere Application Server provides a thin Java Platform, Standard Edition 6 (Java SE 6) web services client runtime implementation based on the Java API for XML-based Web Services (JAX-WS) 2.2 specification. The Thin Client for JAX-WS with WAS is a stand-alone Java SE 6 client environment that enables running unmanaged JAX-WS 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-WS 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-WS is not supported 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-WS.
Before we set up a JAX-WS unmanaged client execution environment, obtain the Thin Client for JAX-WS JAR file. To obtain the Thin Client for JAX-WS, install WAS v9.0 or the Application Client for WAS v9.0. The Thin Client for JAX-WS JAR file, com.ibm.jaxws.thinclient_8.5.0.jar, is located in the app_server_root\runtimes directory.
Copy the Thin Client for JAX-WS, com.ibm.jaxws.thinclient_8.5.0.jar file and the endorsed_apis_8.5.0.jar files, to other machines to create a lightweight client environment that enables communications with the product. Copies of the Thin Client for JAX-WS are subject to the same terms and conditions of the license agreement for the WebSphere product where obtained the Thin Client for JAX-WS. Refer to the license agreements for correct usage and other limitations.
The Thin Client for JAX-WS is supported in the following environments:
- IBM SDKs (SDKs) v6.0
- non-IBM SDKs V6.0 with the following limitation:
- Xerces limitation on non-IBM SDKs
We must download Xerces-J v2.6.2, and add the file to the classpath when setting up the Thin Client for JAX-WS environment.
- WS-SecurityKerberos on non-IBM SDKs
WS-SecurityKerberos is not supported with the Sun JDK or other non-IBM SDKs. Applications running in a Thin Client for JAX-WS environment that make use of WS-Security message level protection and use Kerberos security tokens as described in the Web Services Security Kerberos Token Profile 1.1 specification, do not correctly work on non-IBM JDKs. This limitation exists because of a dependancy on the IBM JGSS provider that is only available within IBM SDKs.
- Equinox 3.6 OSGi runtime environments
Set up a Thin Client for JAX-WS environment by completing the following steps.
Tasks
- Copy the Thin Client for JAX-WS JAR file, com.ibm.jaxws.thinclient_8.5.0.jar, to other machines to create a lightweight client environment.
- Use the Java Endorsed Standards Override Mechanism to override APIs available in the JDK on the system.
Because the Thin Client for JAX-WS with WASv9.0 requires APIs that are more current than what is available in JDKs to support JAX-WS 2.2 and JAXB 2.2 implementations, we must override the default JDK APIs in use by the system using the Java Endorsed Standards Override Mechanism.
Copy the app_server_root\runtimes\endorsed\endorsed_apis_8.5.0.jar file into the default directory, JAVA_JRE\lib\endorsed. Alternatively, we can use the java.endorsed.dirs property to specify a directory of our choice. If we choose to use an alternative directory, it is a best practice to only include the endorsed_apis JAR file.
- Configure the path. Enter the following command to add the Java bin directories to your path:
(Windows) (ZOS)
set PATH=<your_JDK_bin_directory>;%PATH%(AIX) (HPUX) (Solaris) (Linux)
export PATH=<your_JDK_bin_directory>:$PATH- Configure the classpath.
- Add the Thin Client for JAX-WS JAR file to the classpath definition.
If the Thin Client is to use the Java Message Service (JMS), then all the JAR files required must be in the classpath for JMS and for the client so that entries exist for all the required files. Otherwise, required files will not be identified as installed and ready for use.
(Windows) (ZOS)
set CLASSPATH=.;<your_jax-ws_thin_client_install_directory>\com.ibm.jaxws.thinclient_8.5.0.jar; <your_application_jars>;%CLASSPATH%(AIX) (HPUX) (Solaris) (Linux) (iSeries)
export CLASSPATH=.:<your_jax-ws_thin_client_install_directory>/com.ibm.jaxws.thinclient_8.5.0.jar: <your_application_jars>;$CLASSPATH- If we are using a non-IBM SDK, obtain a Xerces xml-apis.jar file and xercesImpl.jar file from the Xerces website, 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
- Optional: Implement policy sets for our client.
- 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.
- Run the client application:
- Enter the following command if we have copied the endorsed_apis_8.5.0.jar file into the JAVA_JRE\lib\endorsed default directory; for example:
(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>- Enter the following command if we have copied the endorsed_apis_8.5.0.jar file into a directory other than the default JAVA_JRE\lib\endorsed directory; for example:
(Windows) (ZOS)
%JAVA_HOME%\bin\java -Djava.endorsed.dirs=<directory_that_includes_endorsed_apis_8.5.0.jar> -Dcom.ibm.SSL.ConfigURL=file:\\\home\sample\ssl.client.props <your_client_application>(AIX) (HPUX) (Solaris) (Linux) (iSeries)
$JAVA_HOME/bin/java -Djava.endorsed.dirs=<directory_that_includes_endorsed_apis_8.5.0.jar> -Dcom.ibm.SSL.ConfigURL=file:///home/sample/ssl.client.props <your_client_application>
If we receive a java.lang.NoClassDefFound error for com.ibm.crypto.provider.RACFInputStream, add the following parameter to your java command:
-Dorg.osgi.framework.bundle.parent=ext
We have set up an unmanaged JAX-WS client runtime environment 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.jaxws.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 static JAX-WS web services clients Example: Installing a web services sample with the console Use JMS to connect to a WAS default messaging provider messaging engine Xerces website Java Endorsed Standards Override Mechanism Web Services Security Kerberos Token Profile 1.1