Samples and applications

The WAS samples gallery provides a set of small, generic samples that show how to perform common enterprise application tasks. The samples demonstrate the use of session and entity enterprise beans, JDBC access, connection pooling, Java Mail, message driven beans, and other Web techniques and reusable componentry. These samples are included in the samples gallery:

For information on how to install the samples into your application server, see Install samples on a standalone application server or Install samples on a federated application server.

WAS also includes two additional applications:

Additional iSeries samples may be available for download from the Websphere Developer's Domain. Link outside Information Center

Here are the steps to install the samples in the WAS samples gallery that are included with the WAS on your iSeries server. If the application server has been federated into a Network Deployment cell, see Install samples on a federated application server.

Install samples on a standalone application server

  1. Verify that Option 3, the WAS samples, is installed by performing these steps:

    1. From your iSeries command prompt, enter the following command:
      DSPSFWRSC
    2. If you see this entry, the samples gallery is installed:
      5733WS5 3 5050 WAS V5.0 Samples

  2. Use the installsamples script to install the samples into a WAS instance. The script is located in the integrated file system in directory /QIBM/ProdData/WebAS5/Base/samples/bin. Follow the steps below to install the samples:

    1. Start the server and the instance into which you want to install the samples.
    2. From the OS/400 command line, start a Qshell session:
      STRQSH
    3. Invoke the installsamples script:
      /QIBM/ProdData/WebAS5/Base/samples/bin/installsamples -instance 
      instanceName -server serverName

      where instanceName is the name of the instance and serverName is the name of server into which to install the samples. If the -instance parameter is not specified, the default instance is used. For more options on the installsamples script, use the -help option.

      Note: Java Message Server (JMS) is not enabled for the default instance. An instance with JMS enabled must be used to install the samples. For information on how to enable JMS, see the Configure the server: Enable your instance to use Java Message Server topic in Administration.

      For example, to install the samples into default server in the default instance shipped with the WAS product, you would invoke installsamples like this:

      /QIBM/ProdData/WebAS5/Base/samples/bin/installsamples -instance default 
      -server server1

    The installsamples script creates the database collections for the samples, installs the sample applications into the specified server, creates the associated resources such as JDBC drivers and Datasources, and updates the required properties files for the samples.

  3. Open a browser to the WAS samples on iSeries main page at the following URL:

    http://your.server.name:port/WSsamples/index.jsp

    where your.server.name is the hostname of your iSeries server and port is either your internal HTTP port number or your external HTTP port number. 9080 is the default internal HTTP port number. Descriptions of the samples are given on that page.

Install samples on a federated application server

  1. Verify that Option 3, the WAS samples, is installed on both the iSeries containing the Network Deployment instance and the iSeries containing the Base application server (if they are different) by performing these steps on both iSeries:

    1. From your iSeries command prompt, enter the following command:
      DSPSFWRSC
    2. If you see this entry, the samples gallery is installed:
      5733WS5 3 5050 WAS V5.0 Samples

  2. Use the installsamplesnd script on the iSeries containing the Network Deployment instance and the finishsamplesnd script on the iSeries containing the application server to install the samples. The scripts are located in the integrated file system in directory /QIBM/ProdData/WebAS5/Base/samples/bin. Follow the steps below to install the samples:

    1. From the OS/400 command line on the iSeries containing the Network Deployment instance, start a Qshell session:
      STRQSH
    2. Invoke the installsamplesnd script:
      /QIBM/ProdData/WebAS5/Base/samples/bin/installsamplesnd -instance 
      instanceName -node nodeName -server serverName

      where instanceName is the name of the Network Deployment instance, nodeName is the name of the node that contains the application server where the samples will be installed, and serverName is the name of application server where the samples will be installed. If the -instance parameter is not specified, the default instance is used. For more options on the installsamplesnd script, use the -help option.

      Note: Java Message Server (JMS) is not enabled for the default instance. An instance with JMS enabled must be used to install the samples. For information on how to enable JMS, see the Configure the server: Enable your instance to use Java Message Server topic in Administration.

    3. Important: after the installsamplesnd script is done, the cell manager server associated with the Network Deployment instance will be running. DO NOT stop this server or the next steps will not work.
    4. From the OS/400 command line on the iSeries containing the application server instance, start a Qshell session:
      STRQSH
    5. Invoke the finishsamplesnd script:
      /QIBM/ProdData/WebAS5/Base/samples/bin/finishsamplesnd
      -instance instanceName

      where instanceName is the name of the WAS Base instance. If the -instance parameter is not specified, the default instance is used. For more options on the finishsamplesnd script, use the -help option.

      Example: Assume WAS Network Deployment installed on an iSeries with the host name ISERIESND and WAS installed on an iSeries with the host name ISERIESBASE. Further assume an instance was created on ISERIESBASE called "myserver" with the default application server name and node name. Lastly, assume the myserver instance has been federated into the Network Deployment cell in the "default" Network Deployment instance on ISERIESND. To install the samples on the "myserver" application server, here are the steps:

      1. On ISERIESND, invoke installsamplesnd like this:
        /QIBM/ProdData/WebAS5/Base/samples/bin/installsamplesnd -instance default 
        -node ISERIESBASE_myserver -server myserver
      2. On ISERIESBASE, invoke finishsamplesnd like this:
        /QIBM/ProdData/WebAS5/Base/samples/bin/finishsamplesnd -instance myserver

    The installsamplesnd script installs the sample applications into the specified server and creates the associated resources such as JDBC drivers and Datasources. The finishsamplesnd script creates the database collections for the samples and updates the required properties files for the samples.

  3. Open a browser to the WAS samples on iSeries main page at the following URL:

    http://your.server.name:port/WSsamples/index.jsp

    where your.server.name is the hostname of your iSeries server and port is either your internal HTTP port number or your external HTTP port number. 9080 is the default internal HTTP port number. Descriptions of the samples are given on that page.

The WAS samples gallery is largely self-explanatory; however, here are some helpful points to keep in mind:

DB2 Web Services Samples

Included with WAS is the DB2 Web Services Samples application. It contains samples for accessing DB2 using the Web Services Object Runtime Framework (WORF). These samples demonstrate the ease of developing Web Services that access iSeries DB2 data.

For WAS for iSeries, using the administrative console install the DB2WebServicesSamples.ear from the directory /QIBM/ProdData/WebAS5/Base/samples/lib/DB2WebServicesSamples/DB2WebServicesSamples.ear
Note: Ensure you are at WAS version 5.0.2 or later.

After deploying the application, start the application server to start the application so you can work with the DB2 Web Services samples. The application's URL is http://your.server.name:port/services. The application uses either your external or internal HTTP port.

IBM Telephone Directory

The IBM Telephone Directory business application ships WAS - Express, but the application can also be installed using WAS for iSeries V5. See the following topic in e-business and Web serving for information about configuring and running the IBM Telephone Directory application: