Running 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 that is based on the Java API for XML-based Web Services (JAX-WS) 2.2 specification. The Thin Client for JAX-WS with WebSphere Application Server 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.

Before you begin

Supported configurations: You can use the Thin Client for JAX-WS with WebSphere Application Server 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 WebSphere Application Server 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 you set up a JAX-WS unmanaged client execution environment, obtain the Thin Client for JAX-WS Java archive (JAR) file. To obtain the Thin Client for JAX-WS, install WebSphere Application Server Version 8.5 or the Application Client for WebSphere Application Server Version 8.5. 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 you 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® Software Development Kits (SDKs) Version 6.0
  • non-IBM SDKs V6.0 with the following limitation:
    • Xerces limitation on non-IBM SDKs

      You must download Xerces-J Version 2.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

About this task

Set up a Thin Client for JAX-WS environment by completing the following steps.

Procedure

  1. 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.
  2. Use the Java Endorsed Standards Override Mechanism to override APIs that are available in the JDK on your system.

    Because the Thin Client for JAX-WS with WebSphere Application ServerVersion 8.5 requires APIs that are more current than what is available in JDKs to support JAX-WS 2.2 and JAXB 2.2 implementations, you must override the default JDK APIs in use by your system by 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, you can use the java.endorsed.dirs property to specify a directory of your choice. If you choose to use an alternative directory, it is a best practice to only include the endorsed_apis JAR file.

  3. Configure the path.
    Enter the following command to add the Java bin directories to your path:
    [Windows]
    set PATH=<your_JDK_bin_directory>;%PATH%
    [Linux][AIX][HP-UX][Solaris]
    export PATH=<your_JDK_bin_directory>:$PATH
  4. Configure the classpath.
    • Add the Thin Client for JAX-WS JAR file to the classpath definition.
      Important: If the Thin Client is to use the Java Message Service (JMS), then all the JAR files that are 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]
      set CLASSPATH=.;<your_jax-ws_thin_client_install_directory>\com.ibm.jaxws.thinclient_8.5.0.jar;
      <your_application_jars>;%CLASSPATH%
      [Linux][AIX][HP-UX][Solaris]
      export CLASSPATH=.:<your_jax-ws_thin_client_install_directory>/com.ibm.jaxws.thinclient_8.5.0.jar:
      <your_application_jars>;$CLASSPATH
    • If you 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]
      set CLASSPATH=.;<your_Xerces_install_directory>\xml-apis.jar;<your_Xerces_install_directory>
      \xercesImpl.jar;%CLASSPATH%
      [Linux][AIX][HP-UX][Solaris]
      export CLASSPATH=.:<your_Xerces_install_directory>/xml-apis.jar:<your_Xerces_install_directory>
      \xercesImpl.jar:$CLASSPATH
  5. Optional: Implement policy sets for your client.
  6. Configure SSL for the client.
    1. Add the following system properties to the Java command:
      -Dcom.ibm.SSL.ConfigURL=file:///home/sample/ssl.client.props
      

      You can obtain the ssl.client.props file from the WebSphere Application Server installation and modify the file to suit your environment. You 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 your 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.jks

      The 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.

  7. Run your client application:
    • Enter the following command if you have copied the endorsed_apis_8.5.0.jar file into the JAVA_JRE\lib\endorsed default directory; for example:
      [Windows]
      %JAVA_HOME%\bin\java -Dcom.ibm.SSL.ConfigURL=file:\\\home\sample\ssl.client.props <your_client_application>
      [Linux][AIX][HP-UX][Solaris]
      $JAVA_HOME/bin/java -Dcom.ibm.SSL.ConfigURL=file:///home/sample/ssl.client.props <your_client_application>
    • Enter the following command if you 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]
      %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>
      [Linux][AIX][HP-UX][Solaris]
      $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>
    Note: If you 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

Results

You have set up an unmanaged JAX-WS client runtime environment to invoke web services hosted on a WebSphere Application Server.
Avoid trouble: The following command illustrates how to display to version of the thin client that you are running:
java -cp (wasHome)/runtimes/com.ibm.jaxws.thinclient_8.5.0.jar com.ibm.ws.webservices.Version
.
The 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