WebSphere Application Server Version 6.1 Feature Pack for Web Services
             Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows, z/OS

             Personalize the table of contents and search results

Accessing Samples

The product provides sample applications and coding examples. Use the sample applications to test your product installation and for guidance on deploying and testing applications. Use coding examples for help on programming.

Samples are for demonstration purposes only. See Limitations of Samples for details.

Samples Gallery
[AIX HP-UX Linux Solaris Windows] [z/OS] Client Samples Gallery
General information

[AIX HP-UX Linux Solaris Windows] [z/OS] You can upgrade the Samples Gallery and Client Samples. For detailed information, refer to app_server_root/samples/readme.html.

Samples Gallery

The Samples Gallery offers a set of Samples that demonstrate common enterprise application tasks. The Gallery also contains descriptions of where to find additional Samples and coding examples.

Quick start - Accessing the Samples Gallery

The Application Server Samples must be installed. You can select to install Samples during product installation or, after the product is installed, separately install the Samples feature. Your application server and the SamplesGallery and PlantsByWebSphere applications must be running.

To view the Samples Gallery, open a browser at http://host_name:server_port/WSsamples where host_name is the name of your server and server_port is the port number for the application server internal HTTP transport. The default URL is:
http://localhost:9080/WSsamples

[Windows] You also can use operating system menus to access the Samples Gallery. Click Start > Programs > IBM WebSphere > Application Server product_version > Profiles > profile_name > Samples Gallery.

Samples Gallery contents

The Samples Gallery includes the following materials:
Plants by WebSphere application
This application demonstrates several Java 2 Platform, Enterprise Edition (J2EE) functions, using an online store that specializes in plant and garden tool sales.

[i5/OS] The PlantsByWebSphere.ear file is installed by default on your application server when you create an application server profile.

Faces Client Tutorial - Sample Portfolio
Sample Portfolio is a sample application that demonstrates the use of faces client components. Hello World Sample demonstrates how the faces client framework keeps a data model consistent in the browser.
Technology Samples
These Samples demonstrate various core components in J2EE applications.
Web Services Samples
These Samples demonstrate J2EE beans and JavaBeans components that are available as Web services.
Service Data Objects (SDO) Sample
This Sample demonstrates data access to a relational database through Service Data Objects (SDO) and Java DataBase Connectivity (JDBC) Mediator technologies.
BeenThere workload management Sample
This Sample demonstrates the workload management and clustering capabilities of the product, and is the only Sample that is supported in a multiple-server, clustered environment.
JACL scripts
These scripts enable you to configure resources and install the Samples.
Programming model extensions Samples in the Samples Gallery
These Samples demonstrate WebSphere programming model extension features such as dynamic query service, work area service, internationalization service, ActivitySessions service, application profiling, Java Transaction API (JTA) extensions, asynchronous beans, and scheduler.

Installing and accessing the Samples Gallery

To view the Samples Gallery, perform the following steps.

  1. Install the product and the Samples.

    Select to install the sample applications. If you do not select to install Samples during the product installation, you can install the Application Server Samples feature later.

    Installing the Application Server Samples feature adds files and subdirectories to the samples directory:
  2. If you do not have an application server with the SamplesGallery and PlantsByWebSphere applications deployed, create an application server profile that deploys the Samples.

    To see if the Samples are already deployed, click Applications > Enterprise Applications in the console navigation tree to access the Enterprise Applications page. When the Samples are deployed, SamplesGallery and PlantsByWebSphere are in the list of applications.

    [z/OS] For information on creating an application server profile, see Configuring the WebSphere Application Server for z/OS product after installation.

    [AIX] [HP-UX] [Linux] [Solaris] [Windows] When creating the application server profile, select Advanced profile creation and Deploy the Sample applications. To test additional samples, also select Deploy the default application. See Creating profiles using the graphical user interface for more information. If you already created an application server profile without the Samples, use the graphical profile creation interface to create additional profiles that contain the Samples.

    You can build or modify the Samples source code to support your project.

    To run the Samples in a distributed WebSphere Application Server Network Deployment environment, install and configure the Samples in a stand-alone application server profile installation, and then use addNode to federate the node into the deployment manager cell. When running the addNode command, use the dmgr_host argument, and -includeapps and -includebuses options. For a complete list of the addNode parameters and their usage, see addNode command. For example, where dmgr_host_name is the name of the machine that hosts your deployment manager profile:
    • [AIX] [HP-UX] [Linux] [Solaris] [Windows] [z/OS]
      addNode.sh/bat dmgr_host_name -includeapps -includebuses
    • [i5/OS]
      addNode dmgr_host_name -includeapps -includebuses
  3. Start the application server.
  4. Ensure that the Samples are running.

    In a console navigation tree, click Applications > Enterprise Applications to access the Enterprise Applications page. When the Samples are running, the SamplesGallery and PlantsByWebSphere applications have a Started status (green arrow).

  5. Access the Samples Gallery.

    Try it out! See the quick start instructions on this page.

    If you have difficulty accessing the Samples Gallery, check the port number.

    [AIX] [HP-UX] [Linux] [Solaris] [Windows] [z/OS] The Plants by WebSphere application is installed on the application server by default. That is, you need not deploy the PlantsByWebSphere.ear file onto the application server. This application is listed as an installed Sample in the Samples Gallery.

  6. Install additional Samples.

    Additional Samples are initially listed as installable Samples in the Samples Gallery.

    [AIX HP-UX Linux Solaris Windows] [z/OS] To deploy them to the application server, use the install script in the app_server_root/samples/bin directory. See the Samples Gallery for more detailed instructions.

    [i5/OS] For further instructions on installing each sample, refer to the Installable Samples section of the Samples Gallery in your Web browser, from Step 4.
    Note: To install additional samples on non-default profiles, you must specify the -server myServer parameter. Additional information about -server parameter and other script values can be found in Installable Samples, Samples install help section.

For information about configuring security for Samples, see the Samples Gallery.

Changing the Samples Gallery port number and troubleshooting

If you are unable to access the Samples Gallery, verify the following items.
  • Verify that the application server is running.
  • Verify that the samples are installed. In the administrative console, click Applications > Enterprise Applications. Confirm that the Samples Gallery is listed as an installed application.
    If the Samples Gallery is not listed as an installed application:
    • Create a new profile using the default profile template.
    • [i5/OS] Issue the following command in a Qshell session from your operating system command line:
      app_server_root/samples/bin/install -profileName profile_name -server server_name -samples SamplesGallery
      For the default profile, server_name is server1. The server name for additional profiles is generally the profile name. If your profile contains more than one node, you must also specify the -node node_name option. For a stand-alone application server profile, you will have multiple nodes if you have created a Web server definition for profile. This happens automatically when you associate an IBM HTTP Server for iSeries HTTP server instance with your application server through the HTTP administrative console.
  • Verify the port number.

    [AIX HP-UX Linux Solaris Windows] [z/OS] The default port is 9080, which is the default value of the HTTP transport of the application server. If the Samples Web address fails, confirm the port number.

    [i5/OS]
    1. In the administrative console navigation frame, click Servers > Application servers.
    2. Click the application server name. For the default application server profile, the server name is server1.
    3. Click Ports.
    4. Verify the WC_defaulthost port number.
    5. If you need to change the port number:
      1. Click WC_defaulthost.
      2. Type the new port number in the Port field.
      3. Click OK.
      4. To save the configuration changes, click Save.
      5. Click Save.
  • [AIX HP-UX Linux Solaris Windows] [i5/OS] You must specify a Samples password when using the manageprofiles command to create a profile for which administrative security is enabled. Otherwise, you will be allowed to create the profile successfully, but when you run the application server containing the Samples, exceptions and failures will be thrown to the server system out log.

Client Samples Gallery contents [AIX HP-UX Linux Solaris Windows] [z/OS]

The Client Samples Gallery demonstrates the following clients.
  • J2EE application client
  • Java thin client
  • Applet client
  • ActiveX to EJB Bridge client

[z/OS] A line mode client is used for the Calculator Client Sample and the MDBSamples client.

Installing and viewing the Client Samples Gallery [AIX HP-UX Linux Solaris Windows]

To view the Client Samples Gallery, install the WebSphere Application Server client on a distributed machine.

Access the Client Samples Gallery on your local file system at app_server_root/samples/index.html.

[AIX HP-UX Linux Solaris Windows] [z/OS] Client Samples: app_server_root/samples/index.html (local file system)

Limitations of the Samples

Additional Samples and examples

IBM Telephone Directory [i5/OS]
The IBM Telephone Directory business application is shipped separately from WebSphere Application Server. For information about obtaining and using the IBM Telephone Directory application, see IBM Telephone Directory V5.2 in the e-business and Web serving topic of the iSeries Information Center.
Samples on developerWorks
Additional WebSphere Application Server Samples are available on WebSphere developerWorks
Samples in tutorials
Many WebSphere Application Server tutorials rely on Sample code. To find tutorials that demonstrate specific technologies, browse the links in Tutorials.
Examples in the product documentation
The product documentation contains many code snippets and examples. To locate these examples easily, see the developer examples in the Reference section of the information center navigation for the product edition that you are using.
Java Samples on the Sun Microsystems Web site
Although they do not showcase the capabilities added by purchasing WebSphere Application Server, the Samples on the java.sun.com Web site demonstrate the basic functionality of various technologies.



Related tasks
Installing J2EE application files
Installing Web Services Samples with the console
Concept topic    

Terms of Use | Feedback

Last updated: Nov 25, 2008 2:35:59 AM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/covr_samples.html