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

The AquaLogic Service Bus tutorials are based on a typical Web Services scenario that uses the AquaLogic Service Bus for configuring business services and adaptive message routing. This section describes tasks required to configure the AquaLogic Service Bus and Weblogic Server environment to deploy the business cases used in the tutorials. The AquaLogic Service Bus example suite is used as a basis for instruction in the following tutorials. (See BEA AquaLogic Service Bus Examples Guide).

You will perform the following pre-requisite tasks to prepare the tutorial domain:

Upon completion of this section, you will know how to deploy a typical Aqualogic Service Bus environment in which you can define resources and design web services. It is necessary to complete all steps in this section before you start the tutorials.

 


About the Scenarios

The tutorials are based on a mortgage broker scenario describing a typical loan application process. 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.

In the first tutorial you will become familiar with the basic functionality of the AquaLogic Service Bus that facilitates web service mediation, including message routing and web service resource creation. In the subsequent tutorials you will develop and customize web services for routing, transforming and validating a loan application.

 


Setting Up the Tutorials

You must execute the following steps to set up and run 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 NormalLoan business 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 NormalLoan business service. The same files structure exists for the other three business services used in this tutorial (ManagerLoanReview, LoanSaleProcessor, and CreditRating).
SimpleBean.java
The jws-181 Web Service definition.
/client/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.

Step 1: Install AquaLogic Service Bus

Install the AquaLogic Service Bus. For installation instructions, see AquaLogic Service Bus Installation Guide.

Step 2: Create an AquaLogic Service Bus Domain

To develop and run the AquaLogic Service Bus tutorials, you must create an AquaLogic Service Bus domain using the Configuration Wizard. You can invoke the Configuration Wizard in the graphical mode or console mode. For this tutorial, you will start the Configuration Wizard in graphical mode.

  1. To start the Configuration Wizard in graphical mode, choose the Configuration Wizard option in the BEA Products group from the Windows Start menu :
  2. Start Arrow symbolAll Programs Arrow symbol BEA Products Arrow symbol Tools Arrow symbol Configuration Wizard

  3. Using the Configuration Wizard, select the product components you want to include in your domain. (See Creating WebLogic Domains Using the Configuration Wizard).
    1. In the Welcome page, the Create a new WebLogic domain radio button is selected by default. Accept the default selection and click Next to proceed.
    2. Figure 2-1 Configuration Wizard - Create Domain Option


      Configuration Wizard - Create Domain Option

    3. In the Select Domain Source page, select the AquaLogic Service Bus radio button. Click Next to proceed.
    4. Figure 2-2 Configuration Wizard - Select Domain Source


      Configuration Wizard - Select Domain Source

    5. In the Configure Username and Password page, configure a new administrator username and password. You can use the default weblogic username but you must create a unique password.
    6. Figure 2-3 Configuration Wizard - Create Username and Password


      Configuration Wizard - Create Username and Password

    7. In the Configure Server Start Mode and JDK page, Development Mode is selected as the default startup mode for the WebLogic domain. Accept the default selection and click Next to proceed.
    8. Figure 2-4 Configure Server Start Mode and JDK


      Configure Server Start Mode and JDK

    9. In the Customize Environment and Services Settings page, the default customization option for the environment and services settings is No. Accept this option and click Next to proceed.
    10. Figure 2-5 Customize Environment and Service Settings


      Customize Environment and Service Settings

    11. Create a domain by specifying domain name as ServiceBusTutorial.Click Create.
    12. Figure 2-6 Configuration Wizard - Create Weblogic Domain


      Configuration Wizard - Create Weblogic Domain

Step 3: Change Domain Configuration Settings

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

BEA_HOME\weblogic92\samples\servicebus\examples

This directory has two subdirectories: \build and \src. You must configure 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.

Configure the examples.properties File

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

BEA_HOME\weblogic92\samples\servicebus\examples\src
To Modify the examples.properties File
  1. Open the examples.properties file using your default text editor. The WebLogic server configuration in the examples.properties file will be as shown in the following file fragment:
  2. Figure 2-7 example.properties - Initial Settings


    example.properties - Initial Settings

  3. Change the hostname to the name of the machine on which the ServiceBusTutorial domain is running. The default hostname localhost specified in the examples.properties can be used.
  4. Change the port number to the port number of the ServiceBusTutorial domain. The port number 7021 specified in the examples.properties file, is the default port number of the examples domain.
  5. Enter the new username and password that you specified when creating the domain. The default username and password in the examples.properties file is set as weblogic.
  6. If you had changed the default name of the Admin Server, change the server name to the Admin Server name you specified when you created the ServiceBusTutorial domain. The default name assigned to the Admin Server by the Configuration Wizard is AdminServer.
  7. Note: The username newuser and password newpassword shown in the following edited examples.properties file, have to be substituted with your new username and password.
  8. Save the edited examples.properties file.

After you have completed editing settings, the examples.properties file must be displayed as shown in the following figure.

Figure 2-8 example.properties - Edited Settings

example.properties - Edited Settings

Edit the setEnv Script

The setEnv script contains the path to the setDomainEnv.cmd file used in a domain. The setEnv script file is named setEnv.cmd on Windows and named setEnv.sh on UNIX systems. You must edit the setEnv script file appropriate for your operating system, to reflect the path to the setDomainEnv.cmd file in the ServiceBusTutorial domain.

To Modify the setEnv Script
  1. Locate the script file appropriate for your operating system in the following directory:
  2. BEA_HOME\weblogic92\samples\servicebus\examples\src
  3. Open the script file using your default text editor.
  4. Edit the script file to reflect the following new path:
  5. 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.

  6. Save the edited script file.
To Run the setEnv Script

On Windows:

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

On UNIX:

% cd BEA_HOME/weblogic92/samples/servicebus/examples/src
% setEnv

where BEA_HOME is the directory in which you installed AquaLogic Service Bus.

Edit the setDomainEnv.cmd file (Windows 2000 Users Only)

You must execute the following additional step if you use Windows 2000. On systems using Windows 2000, the length of the class path prevents you from running ant tasks executed during the tutorial. This additional step provides a workaround using the subst command to shorten the classpath passed by the ant tasks.

To Shorten the Class Path

  1. Open the setDomainEnv.cmd file located in the following directory:
  2. BEA_HOME\user_projects\domains\ServiceBusTutorial\bin\
  3. In the setDomainEnv.cmd file locate the entry that sets the PRE_CLASSPATH. The instruction will be listed as follows:
  4. set PRE_CLASSPATH=%PRE_CLASSPATH%;%WL_HOME%\servicebus\lib\sb-public.jar;%
  5. Identify any three unused drive letters (for example, X, Y, and Z) and add the following code to the beginning of the file:
  6. subst X: %WL_HOME%\servicebus\lib
    subst Y: %WL_HOME%\integration\common\lib
    subst Z: %WL_HOME%\server\lib
  7. Edit the PRE_CLASSPATH entry, replacing the path with the appropriate drive letter. For example:
  8. 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
  9. Save changes to the setDomainEnv.cmd file and close the file.
  10. Run the setDomainEnv.cmd script by entering the following commands:
  11. cd BEA_HOME\user_projects\domains\ServiceBusTutorial\bin\
    run setDomainEnv.cmd

Step 4: Start BEA AquaLogic Service Bus

You can start the AquaLogic Service Bus using one of the following methods:

When the AquaLogic Service Bus is started, a server command console window will display status information about the WebLogic Server.

Note: A valid username and password is required to start the server, if a production mode domain is used. For more information about creating and configuring domains, see Creating WebLogic Domains Using the Configuration Wizard.

Step 5: Build and Deploy Business Services

After you start the WebLogic server, you must run the build script to perform the following tasks:

To Build and Deploy the Business Services

The following four web services have to be built and deployed, to implement the business services associated with the mortgage broker scenario used in the tutorials:

  1. Open a command window and ensure that you have run the setEnv script. For instructions to run the setEnv script, see To Run the setEnv Script.
  2. Navigate to the webservices\jws_basic directory. This directory contains four business services folders, one for each of the business services to be implemented in this tutorial.
  3. cd BEA_HOME\weblogic92\samples\servicebus\examples\src\examples\webservces\jws_basic
  4. Navigate to the appropriate directory for the business service you want to build. For example, to build the NormalLoan business service, select the normal folder:
  5. cd normal
    Note: To build the other business services (CreditRating, LoanSaleProcessor, and ManagerLoanReview), select the respective business service folders.
  6. To deploy the Web Service, enter ant and press Enter. A message is displayed on the console, indicating success or failure of the executed operation.
  7. To test the deployed Web Service, enter ant run and press Enter. A message from the business service is displayed at the command line. The message indicates whether the Web Service was run successfully.
  8. Repeat step 3 through step 5 of these build and deploy instructions to build each of the remaining Web Services (CreditRating, LoanSaleProcessor, and ManagerLoanReview) used in this tutorial.

Step 6: Log in to the AquaLogic Service Bus Console

The AquaLogic Service Bus Console is a web services management dashboard which allows you to monitor web services and servers, and perform service management tasks. The console enables you to perform operational tasks such as configuring proxy and business services, setting up security, managing resources, and capturing data for tracking or regulatory auditing. It provides views to monitor current state and health of the AquaLogic Service Bus environment, by displaying detailed statistics about servers, services, and alerts. The AquaLogic Service Bus Console also enables you respond rapidly and effectively to changes in your service-oriented environment.

To log in to the AquaLogic Service Bus Console
  1. Open a browser window and enter the following URL:
  2. 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:7001/sbconsole
  3. The AquaLogic Service Bus Console login page is displayed. Enter the username and password that you specified when you created the AquaLogic Service Bus tutorial domain.
Note: You can also open the AquaLogic Service Bus Console from the Windows Start menu by selecting the following options:
Note: Start Arrow symbolAll Programs Arrow symbol BEA Products Arrow symbol User Projects Arrow symbol domain_nameArrow symbolStart Server for AquaLogic Service Bus Admin Console
Note: You must specify the name of the AquaLogic Service Bus domain you created for this tutorial as the domain_name.

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 loan application routing scenario. Each of the tutorials include instructions to design and configure the AquaLogic Service Bus resources, and procedures you can use to test the completed configurations.


  Back to Top       Previous  Next