+

Search Tips   |   Advanced Search

Running an unmanaged Web services JAX-WS client


WAS provides an unmanaged client implementation that is based on the Java API for XML-based Web Services (JAX-WS) 2.1 specification. The Thin Client for JAX-WS with WAS is an unmanaged and stand-alone Java client environment that enables running JAX-WS Web services client applications to invoke Web services that are hosted by WAS.

Before you 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 V7.0 or the Application Client for WAS Version 7.0. The Thin Client for JAX-WS JAR file, com.ibm.jaxws.thinclient_7.0.0.jar, is located in...

APP_ROOT\runtimes

Copy the Thin Client for JAX-WS, com.ibm.jaxws.thinclient_7.0.0.jar file, to other machines to create a lightweight client environment that enables communications with WAS ND. 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 works with IBM Software Development Kits (SDKs) Version 6.0. The Thin Client for JAX-WS is also supported on non-IBM SDKs V6.0 with this limitation:

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

 

  1. Set the path. Enter the following command to add the Java bin directories to your path:

    (Windows)

    set PATH=<my_JDK_bin_directory>;%PATH%
    

    [AIX] [HP-UX] [Solaris]

    [Linux]

    export PATH=<my_JDK_bin_directory>:$PATH
    

  2. Set the classpath.

    • Add the Thin Client for JAX-WS JAR file to the classpath definition.

      (Windows)

      set CLASSPATH=.;<my_jax-ws_thin_client_install_directory>\com.ibm.jaxws.thinclient_7.0.0.jar;
      <my_application_jars>;%CLASSPATH%
      

      [AIX] [HP-UX] [Solaris]

      [Linux]

      export CLASSPATH=.:<my_jax-ws_thin_client_install_directory>/com.ibm.jaxws.thinclient_7.0.0.jar:
      <my_application_jars>;$CLASSPATH
      

    • For a non-IBM SDK, obtain a Xerces xml-apis.jar file and xercesImpl.jar file from the Xerces Web site, and configure the classpath definition.

      (Windows)

      set CLASSPATH=.;<my_Xerces_install_directory>\xml-apis.jar;<my_Xerces_install_directory>
      \xercesImpl.jar;%CLASSPATH%
      

      [AIX] [HP-UX] [Solaris]

      [Linux]

      export CLASSPATH=.:<my_Xerces_install_directory>/xml-apis.jar:<my_Xerces_install_directory>
      \xercesImpl.jar:$CLASSPATH
      

  3. Set SSL for the client.

    1. Add the following system properties to the Java command:

      -Dcom.ibm.SSL.ConfigURL=file:
      ///home/sample/ssl.client.props
      
      

      We can obtain the ssl.client.props file from the WAS installation and modify the file to suit the 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 the 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.

  4. Enter the following command to run the client application:

    (Windows)

    %JAVA_HOME%/bin/java -Dcom.ibm.SSL.ConfigURL=file:
    ///home/sample/ssl.client.props <my_client_application>
    

    [AIX] [HP-UX] [Solaris]

    [Linux]

    $JAVA_HOME/bin/java -Dcom.ibm.SSL.ConfigURL=file:
    ///home/sample/ssl.client.props <my_client_application>
    

 

Results

we have set up an unmanaged JAX-WS client runtime environment to invoke Web services hosted on a WAS.

 

Related tasks


Task overview: Implement Web services applications
Implementing JAX-WS Web services clients
Example: Installing a Web Services Sample with the console

 

Related information


Xerces Web site