Enabling DB2 as a web service provider

Enabling DB2® as a web service provider allows you to create web services on z/OS® with your DB2 data and applications.

About this task

DB2 for z/OS as a web service provider has the following prerequisites:

  • Enable JDBC (legacy or universal) in DB2.
  • Install WebSphere® Application Server Version 5 or later on z/OS.
  • Ensure that the WebSphere Application Server library contains the following two files:
    • mail.jar
    • activation.jar
    If mail.jar is not present, download JavaMail Version 1.2 or later. If activation.jar is not present, download JavaBeans Activation Framework Version 1.0.1 or later.
To use DB2 Web Services Object Runtime Framework (WORF), you need to make the run time services available to WebSphere Application Server (WAS). By default, WORF is installed in the HFS directory:
/usr/lpp/db2a10_worf/
The base installationdirectory contains the lib/ subdirectory that contains the run time JAR file worf.jar. To begin using WORF, copy worf.jar, mail.jar, and activation.jar to a WAS shared library directory that you have already set up and restart WAS.
WORF provides a sample web application in the following directory:
lib/services.war
The application contains sample Document Access Definition Extension (DADX) files that define sample DB2 web services.

Procedure

To set up this application with sample DADX files:

  1. Follow the instructions in the job prolog to customize and run job DSNTEJWS, which is located in the prefix.SDSNSAMP directory. DSNTEJWS creates the DB2 tables that are used by the sample application.
  2. The sample application is set up to use universal JDBC driver connectivity to connect to a z/OS DB2 server. Configure WAS with JDBC providers that make use of universal JDBC driver and perform the following steps:
    1. Copy services.war to a temporary directory.
    2. Extract services.war by issuing the following command:
      jar -xvf services.war
    3. Open the group.properties files, which are located in the following directories:
      WEB-INF/classes/groups/dxx_sample
      WEB-INF/classes/groups/dxx_travel
      Modify the dbDriver, dbURL userID, and password fields to have the following values:
      dbDriver=com.ibm.db2.jcc.DB2Driver
      dbURL=jdbc:db2://server:port/database
      userID=DB2 userid
      password=DB2 userid password
    4. Compress the files by issuing the following command:
      jar -cvf services.war *
  3. Use a web browser to connect to your WAS Administrative Console.
  4. Under "Applications", select "Install New Application".
  5. Select the "Server Path" option, and type the location of the services.war file in the text box. If you installed WORF in the default location, the server path is:
    /usr/lpp/db2a10_worf/lib/services.war
  6. Enter a context root for the application (for example, services). Click "Next".
  7. On the following screens, respond as necessary for your local setup. You can accept the default settings.
  8. On the last screen, click "Finish". Click "Save to Master Configuration" to apply your changes.

What to do next

To load the application:

  1. On the WAS Administrative Console's main page, under "Applications", select "Enterprise Applications". Select the application and click "Start" to load the application.
  2. After the application loads, point a browser to your server with the context root that you chose (for example, http://server:port/services/). The welcome page lists the sample DADX files that are provided in services.war. To test the services, click on the links.