Tutorials

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Getting Started with the BEA AquaLogic Service Bus Tutorials

In this chapter, you learn to:

Complete the steps in this section before you start the tutorials.

The AquaLogic Service Bus tutorials guide you through designing and configuring AquaLogic Service Bus resources and deploying a configuration. These tutorials use the AquaLogic Service Bus example suite as a basis for instruction. (See BEA AquaLogic Service Bus Examples Guide)

 


About the Scenarios

The tutorials describe a typical mortgage broker scenario for a loan application request. A primary mortgage company uses AquaLogic Service Bus to route loan applications to appropriate business services. The loan applications are routed to different business services depending on qualifying criteria, such as the requested interest rate and the requested principal amount. The applicant's credit rating information is required to complete the loan request when the principal amount is greater than US$ 25 million.

Complete the first tutorial to become familiar with AquaLogic Service Bus. The subsequent tutorials build on what you learn in the first tutorial. These tutorials explore the basic functionality of AquaLogic Service Bus, including message routing and enrichment.

 


Setting Up the Tutorials

The files (including pre-built business services) that support the building of the tutorial solutions are located in the following directory:

BEA_HOME\weblogic92\samples\servicebus\examples

The tutorial files contain properties that you must set to run the tutorials. In the tutorial, you can use four different business services. Each business service also has a set of files associated with it. The files structure for each of the business services is the same—the directory structure for one of the business services, the normal service, is described in Table 2-1. You can explore the other directories as an exercise.

Table 2-1 Sample Files Provided in Support of the Tutorials
Filename/Location
Description
/src/setEnv.cmd
This file sets the environment properties.
/src/examples.properties
This file contains business service build and deployment properties.
For each business service:
BEA_HOME/weblogic92/samples/servicebus/examples/src/examples/webservices/jws_basic/normal
The files contained in this folder are those required by the normal business service. The same files structure exists for the other three business services used in this tutorial (manager, large, and credit).
SimpleBean.java
The jws-181 Web Service definition.
LoanStruct.java
The definition of the message.
build.xml
The build script that is used to build each of the services using ant.
*.wsdl
A Web Service Definition Language (WSDL) file defines each of the services.
/client/Main.java
The Java client with which each of the business services interacts.

You must execute the following steps to set up and run the tutorials:

Step 1: Install AquaLogic Service Bus

  1. Install AquaLogic Service Bus. For instructions, see AquaLogic Service Bus Installation Guide.
  2. Create a new AquaLogic Service Bus domain in which to develop the tutorials. The Configuration Wizard guides you through the process of creating a new domain using the configuration templates.
  3. For this tutorial, in the Configuration Wizard, ensure that you:

    • Select the AquaLogic Service Bus check box when you select the domain source.
    • Select Development Mode and the default PointBase database.
    • Create a domain named ServiceBusTutorial.
    • For instructions on how to use the configuration wizard, see Creating WebLogic Domains Using the Configuration Wizard.

Step 2: Change the Configuration Settings

To develop and run the AquaLogic Service Bus tutorials you must modify some of the configuration properties. The associated files are located in the following directory:

BEA_HOME\weblogic92\samples\servicebus\examples

There are two subdirectories: \build and \src. Make the configuration changes to the files in the \src directory.

Table 2-2 Configuration Settings
Folder Name
Description
\build
This folder contains the files required to run the pre-configured AquaLogic Service Bus examples provided in the AquaLogic Service Bus Examples domain.
\src
This folder contains the files that support the development and execution of the AquaLogic Service Bus tutorial. While developing the tutorial you will modify some of the files contained in this folder, such as examples.properties.

Edit the examples.properties File

To deploy the business services on your running tutorial domain, you must modify the properties that specify the WebLogic Server behavior. You can modify the properties in the WebLogic configuration section of the following file:

BEA_HOME\weblogic92\samples\servicebus\examples\src\examples.properties 
To Modify the examples.properties File
  1. Change the hostname to the name of the machine on which the ServiceBusTutorial domain is running.
  2. Change the port number to the port number of the tutorial domain.
  3. Enter the username that you specified when creating the domain.
  4. Enter the password that you specified when creating the domain.
  5. Change the server name to the name you specified when you created the domain (if you specified a name other than the default name (AdminServer) assigned by the Configuration Wizard).
  6. Listing 2-1 Fragment of examples.properties File
    ### WebLogic configuration ###
    -- Configure per your WLS installation.
    wls.hostname=localhost
    wls.port=7021
    wls.username=weblogic
    wls.password=weblogic
    wls.server.name=xbusServer

Edit and Run the setEnv Script

Edit the setEnv script (setEnv.cmd on Windows or setEnv.sh on UNIX systems) in the following directory to replace the default path with the path to your tutorial domain's setDomainEnv script.

BEA_HOME\weblogic92\samples\servicebus\examples\src

The new path is:

BEA_HOME\user_projects\domains\ServiceBusTutorial\bin\setDomainEnv.cmd.

where BEA_HOME\user_projects is the default directory in which you created your ServiceBusTutorial domain. (Use setDomainEnv.cmd or setDomainEnv.sh, as appropriate for your operating system.)

To Run the setEnv Script

On Windows:

  1. Open a command window.
  2. Change to the following directory:
  3. BEA_HOME\weblogic92\samples\servicebus\examples\src\examples
  4. In the examples directory, on the command line, run the following command:
  5. ..\setEnv.cmd

On UNIX:

% cd BEA_HOME/weblogic92/samples/servicebus/examples/src/examples
% ../setEnv
Where:

Edit the setDomainEnv.cmd File—Windows 2000 Users Only

This step is only for Windows 2000 users. On Windows 2000 machines, a class path length problem prevents you from running ant tasks and executing the tutorial. This work around uses the subst command to shorten the classpath passed by ant. Follow these steps to shorten the classpath:

  1. Edit the setDomainEnv.cmd file located in the Service Bus domain installation location, BEA_HOME\user_projects\domains\ServiceBusTutorial\bin\
  2. In the setDomainEnv.cmd file search for the instruction that sets the PRE_CLASSPATH. The instruction looks like:
  3. set PRE_CLASSPATH=%PRE_CLASSPATH%;%WL_HOME%\servicebus\lib\sb-public.jar;%
  4. Identify three unused drive letters (for example, X, Y, and Z) and add the following code to the beginning of the file:
  5. subst X: %WL_HOME%\servicebus\lib
    subst Y: %WL_HOME%\integration\common\lib
    subst Z: %WL_HOME%\server\lib
  6. Edit the PRE_CLASSPATH entry, replacing the path with the appropriate drive letter. For the example:
  7. set PRE_CLASSPATH=%PRE_CLASSPATH%;X:\sb-public.jar;X:\sb-internal.jar;Y:\wlicommon.jar;Y:\qs_p13n_system.jar;X:\xbus-core.jar;Z:\wlxbean.jar;Z:\xquery.jar;Z:\apache_xbean.jar;Z:\binxml.jar
  8. Save the changes and close the setDomainEnv.cmd file.
  9. Run the setDomainEnv.cmd script by entering the following commands:
    1. cd BEA_HOME\user_projects\domains\ServiceBusTutorial\bin\
    2. run setDomainEnv.cmd

Step 3: Start BEA AquaLogic Service Bus

Start AquaLogic Service Bus using one of the following methods:

Note: If you created a production mode domain, enter a valid username and password to start the server. For more information about domains, see Creating WebLogic Domains Using the Configuration Wizard.

Step 4: Build and Deploy the Business Services

You must start the server before building the Web Services. See Step 3: Start BEA AquaLogic Service Bus. After the server is started, you must run a build script to:

To Build and Deploy the Business Services
  1. In the command window, ensure that you have run the setEnv script, as described in To Run the setEnv Script.
  2. Change to the webservices\jws_basic directory.
  3. cd BEA_HOME\weblogic92\samples\servicebus\examples\src\examples\webservices\jws_basic

    The directory contains four business service folders. Complete step 3 to step 5 to build and run each of the business services.

  4. Change to the normal directory:
    cd normal
  5. Note: To build the other business services (credit, large, and manager), change to the appropriate business service folder.
  6. To deploy the Web Service, enter ant, then press Enter.
  7. A message indicating whether the command was successfully executed is displayed on the console.

  8. To test the deployed Web Service, Enter ant run, then press Enter.
  9. A message from the business service is displayed at the command line. The message indicates whether the Web Service was run successfully.

  10. To build the remaining Web Services (credit, large, and manager) that you will use in this tutorial, repeat step 3 through step 5 of these build and deploy instructions for each of the folders listed in the \jws_basic directory.

Step 5: Log in to the AquaLogic Service Bus Console

To log in to the AquaLogic Service Bus Console, open a browser window and enter the following URL in your browser:

http://host:port/sbconsole

where host:port represents the name and port number of the machine on which WebLogic Server is running. For example, if WebLogic Server is running on your local machine using the default port configuration, enter the following URL in your browser:

http://localhost:7021/sbconsole

The AquaLogic Service Bus Console login page is displayed. Enter the username and password that you specified when you created the AquaLogic Service Bus domain.

Where to Go from Here

After you complete the steps required to set up the tutorials, you can proceed to Tutorial 1. Routing a Loan Application, which describes how you can configure BEA AquaLogic Service Bus with the resources required for the routing scenario.

Each of the tutorials include instructions to design and configure the AquaLogic Service Bus resources, followed by test sections that you can use to test the completed configurations.


  Back to Top       Previous  Next