Tutorials

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

Tutorial 1. Routing a Loan Application

ALSB enables adaptive message routing between business services in an enterprise environment. Messages can be routed from a client through the ALSB intermediary, to the appropriate business service. ALSB routes messages to one or more destinations, based on the actions configured in the message processing logic. These routing actions are configured using ALSB Console. Routing provides an efficient alternative to building a multitude of static point-to-point web service connections between pairs of systems.

This section includes the following topics:

 


Prerequisites

You must complete Getting Started with the ALSB Tutorials before beginning this tutorial.

 


Tutorial Objectives

The objective of this tutorial is to create and test a routing scenario using the graphical environment provided in ALSB Console. It includes the following tasks:

This tutorial introduces you to:

 


Definition of the Scenario

A primary mortgage company uses ALSB to route loan applications to appropriate business services based on the interest rate requested. An application containing a request for a rate less than 5% requires management approval and is routed to an appropriate business service for processing. All other loan applications are routed to the appropriate business service for processing.

Figure 3-1 summarizes the logical architecture to support this scenario. It illustrates how ALSB mediates the messaging between the clients and the business services in your enterprise.

Figure 3-1 Expose a Loan Application Request Web Service via ALSB

Expose a Loan Application Request Web Service via ALSB

Overview of the Run-Time Process in ALSB

A client sends a loan application to a proxy service named LoanGateway1. The default proxy service has a conditional routing stage that checks the value of the requested interest rate in the loan application document. If the interest rate is less than 5%, the loan application is routed to the ManagerLoanReview business service; otherwise it is routed to the NormalLoan business service. The target business service returns a response similar to that shown in Figure 3-42.

Note: If the loan application is processed by the NormalLoan business service, MANAGER is replaced with NORMAL in the generated response.

Required Resources

The following table lists the resources required to develop and run this tutorial.

Table 3-1 Routing Loan Application Tutorial Resources
Resource Name
Description
normalLoan
This is the WSDL resource.
NormalLoan
This is business service used by ALSB.
ManagerLoanReview
This is business service used by ALSB.
LoanGateway1
This is the ALSB proxy service.

 


Tasks in This Tutorial

In this tutorial, ALSB is used to route a loan application within a mortgage company to a target a web service depending on the interest rate requested. Perform the following tasks to design and configure a proxy service and the associated resources in ALSB to implement this use case scenario.

Prepare the Environment

Ensure that ALSB is running in the domain that you have created for the tutorial and that you have completed the tasks described in Setting Up the Tutorials.

Create a Session and Set up a Project

Using ALSB Console, you can monitor resources and configurations in ALSB environment. You can perform system monitoring without initiating a session. However, you must first create an session in the ALSB Console to update or delete resources and modify their configuration properties.

The Change Center in the console allows you to create and manage sessions. All updates to the system configuration during the current session are saved as temporary files. These changes effective only when the current session is activated. Figure 3-2 illustrates the Change Center pane available on ALSB Console.

Figure 3-2 Manage Sessions Using Change Center

Manage Sessions Using Change Center

In addition to creating and activating sessions, the Change Center allows you to perform the functions summarized in the Table 3-2.

Table 3-2 Change Center Options
Click
To…
Create
Create a new session. You must create a session to make changes to the configuration. You can exit this session using the Exit function, then re-enter it by clicking Edit. Once in the session, you can continue to modify the resources.
Edit
Enter a session that you previously created and exited. You must activate a session before you can use Edit.
Exit
Discontinue the session and save the session state. Click Edit to re-enter the discontinued session.
Discard
End the current session without saving the changes.
Activate
Save the current session’s configuration to the run time.
When you click Activate, the Activate Session page is displayed. In this page, the user and session name of the session are displayed. If required, you can add a description. Click Submit to save the current session’s configuration to the run time.

Note: It is recommended that you click Create before modifying any system configuration settings on the console. It is a good practice to save your configuration changes incrementally. To save and activate configuration changes in the current session, you must click Activate after you have completed making a set of changes.

To create the MortgageBroker Project and File Folders

In the ALSB system environment, system configuration entities are grouped into user-defined projects. On ALSB Console, the Project Explorer page displays a default project and the various user defined projects under the Projects folder. This page allows you to perform all project configuration tasks. Each project is represented by a project folder on the console. You can add new project folders and navigate the project trees. You can collapse and expand folders as required by clicking them.

There are pre-defined resources types in the ALSB system environment. Each resource type is represented as a sub folder within the Project folder.You can create and configure resources of different types within the resource type folders.

This section describes the tasks to start a session and create a MortgageBroker project under the Projects folder. For this scenario, you will create three resource folders in the MortgageBroker project to hold each of the following pre-defined resource types:

To Start a Session and Create a Project
  1. In the ALSB console Change Center click Create to create a new session.
  2. In the ALSB Console navigation pane, select the Project Explorer.
  3. The project explorer opens in the navigation pane and a Project page is displayed on the console.

  4. In the Enter New Project Name field in the Projects section, type MortgageBroker as shown in Figure 3-3.
  5. Figure 3-3 Create a Project


    Create a Project

  6. Click Add Project.

The MortgageBroker project is created and listed in the Project Explorer under Projects.

You must create a project folder WSDL first, and add a WSDL resource to it. The WSDLs are the basis on which you create the business services and the proxy service. You subsequently create other folders and resources for this scenario.

To Create a Project Folder
  1. In the project explorer, click the MortgageBroker project to open the associated project page.
  2. On the Project page, in Folders, enter the folder name in the field provided. In this case, enter WSDL as displayed in Figure 3-4.
  3. Figure 3-4 Create a Folders


    Create a Folders

  4. Click Add Folder.
  5. The WSDL folder is displayed in the list of project folders for the MortgageBroker project.

  6. Repeat step 2 and step 3 to create the following additional folders: ProxyService and BusinessService.
  7. When all three folders are created, click Activate, then Submit to save the project directory structure. The Change Center environment setting options are listed in Table 3-2.

Create the WSDL Resources

ALSB resources are configured using configuration wizards. Each configuration wizard includes a sequence of pages that prompt you for information about the resource and provide property configuration options.

To Create the normalLoan WSDL Resource

A WSDL defines the public contract (interface specification) between a client and a service, whether the service is a proxy service or a business service. It is the formal description of a web service. A WSDL is used to describe what a web service’s interface is, where it resides, and how to invoke it. You create the WSDL resource first since subsequent service registration tasks depend on it. The WSDL is subsequently used to register the business service with the proxy service.

To Import a WSDL
  1. In the ALSB console Change Center click Create to create a new session.
  2. In ALSB Console navigation pane, select the Project Explorer.
  3. In the project explorer, click MortgageBroker to expand the folder, then click WSDL to open the WSDL folder.
  4. In the Resources pane, from the Select Resource Type drop-down list, select WSDL.
  5. Figure 3-5 Select a Resource Type

    Select a Resource Type

    The Create a New WSDL Resource page is displayed.

  6. Enter the following information in the Create a New WSDL Resource page (see Figure 3-6):
    1. Enter normalLoan as the resource name.
    2. Click Browse… . Select the WSDL associated with the normal loan process:
    3. BEA_HOME\alsb_3.0\samples\servicebus\examples\src\examples\webservices\jws_basic\normal\NormalLoanApprovalService.wsdl

    4. Optionally, enter information in the Resource Description field to describe the resource.
    5. The resource is now displayed in the resources pane. The displayed Create a New WSDL Resource page must be similar to the page shown in Figure 3-6.
    6. Click Save to create the WSDL resource.

      Figure 3-6 Create a WSDL Resource


      Create a WSDL Resource

      This step completes the creation of the normalLoan WSDL resource in the WSDL folder. Activate the session. For more information on how to activate a session, see Table 3-2.

Create the managerApproval WSDL Resource

Complete tasks in step 1 to step 5, to create a WSDL resource associated with the ManagerApproval Service, using the procedure in To Import a WSDL section. To import the ManagerApprovalService WSDL resource, you must use the configuration parameters listed in the following table.

Table 3-3 ManagerApproval Service WSDL
Configuration Parameter
Value
Resource Name
managerApproval
ManagerApprovalService WSDL
BEA_HOME\alsb_3.0\samples\servicebus\examples\src\examples\webservices\jws_basic\manager\ManagerApprovalService.wsdl

Create a Proxy Service

In this section, you will create a proxy service. The proxy service is used to route the loan application to the appropriate business service.

To Create the Proxy Service
  1. In the ALSB console Change Center click Create to create a new session.
  2. In the Project Explorer, select the MortgageBroker project. The project folder is expanded to show the directory structure of the project.
  3. Select the ProxyService folder. The MortgageBroker/ProxyService page is displayed.
  4. In the Select Resource Type drop-down list, select Proxy Service.
  5. The Create a Proxy Service - General Configuration page is displayed as shown in Figure 3-7.

    Figure 3-7 Create a Proxy Service


    Create a Proxy Service

  6. Name the proxy service, LoanGateway1.
  7. In Service Type, select WSDL web service, then click Browse… .
  8. The Select a WSDL page is displayed. The proxy service is based on the WSDL resource that you originally created, hence you must reference the resource here.

  9. Select the normalLoan WSDL. The Select WSDL Definitions pane is populated with the content categories of the WSDL.
  10. Figure 3-8 Select WSDL Definition


    Select WSDL Definition

    1. In Select WSDL Definitions pane, from the Ports category, Click helloPort, which is the WSDL port for the normalLoan WSDL (helloPort).
    2. Click Submit. The port name is displayed in the WSDL port text field as shown in Figure 3-9.
    3. Figure 3-9 LoanGateway1 Proxy Service


      LoanGateway1 Proxy Service

  11. Click Next to continue configuring the proxy service.
  12. Accept the default protocol, http.
  13. Note: The protocol you select on this page determines the format for the endpoint URI that you will specify in the next step. The assumed default protocol is http since it is used by most services.
  14. Set the Endpoint URI to /loan/gateway1. This is the URI to which the client will send its messages.
  15. Accept the default for the Get All Headers option (No). The Create a Proxy Service-HTTP Transport Configuration page is displayed as shown in Figure 3-10.
  16. Click Next.
  17. Figure 3-10 Transport Configuration of Proxy Service


    Transport Configuration of Proxy Service

  18. Accept the default settings for the HTTP transport configuration in HTTP Transport Configuration page (see Figure 3-11).
  19. Figure 3-11 HTTP Transport Configuration


    HTTP Transport Configuration

    The Create a Proxy Service - Operation Selection Configuration page is displayed as shown in Figure 3-12. On this page you will select the metadata accompanying the message, which identifies the web service operation to be invoked.

    Figure 3-12 Operation Selection Configuration of Proxy Service


    Operation Selection Configuration of Proxy Service

  20. Accept the default selection algorithm (SOAP Body Type). Click Next. The Create a Proxy Service– Summary page is displayed as shown in the Figure 3-13. This page shows a summary of configuration settings for the proxy service.
  21. Note: The default service is an RPC web service. As a result, the SOAP body contains the service operation selection information. An operation in a Java web service WSDL corresponds to a public method in the Java web service. If there are multiple public methods accessible to a client, each public method type will have an operation definition in the WSDL. For a SOAP based RPC service, the SOAP body indicates the operation (method) selected by the client. The SOAP header can also specify the operation. However, by convention, the SOAP body defines this.
    Figure 3-13 Proxy Service - Configuration Settings Summary


    Proxy Service - Configuration Settings Summary

    Before registering the proxy service, you can review the configuration settings and change them if necessary, by clicking Edit icon.

  22. After reviewing the proxy service configuration settings, click Save to register the service.
  23. Note: You must always select Save before activating a session configuration in the Change Center.

    The LoanGateway1 proxy service is displayed in the Resources pane in the ProxyService folder of the MortgageBroker project. Click the LoanGateway1 link in the Resources pane of MortgageBroker/ProxyServices to go the View a Proxy Service page.

    Figure 3-14 Proxy Services in Resource Pane


    Proxy Services in Resource Pane

  24. The View a Proxy Service page is displayed as shown in Figure 3-15. The Operational Settings tab on this page has options to enable monitoring for the proxy service.
  25. Figure 3-15 Monitoring Configuration of Proxy Service


    Monitoring Configuration of Proxy Service

    To enable monitoring:

    1. Click the Operational Settings tab.
    2. Select the Enabled check box for the Monitoring setting.
    3. Choose an aggregation interval for the service. The aggregation interval is the period over which aggregated statistics related to the service are computed for display in the ALSB Console dashboard. You can also accept the default value for the Aggregation Interval, which is set to five minutes.
    4. For more information about using the ALSB Dashboard and monitoring services, see: Monitoring in Using the AquaLogic Service Bus Console and AquaLogic Service Bus Operations Guide.

    5. Click Update.
    6. Click the Back button at the bottom of the View a Proxy Service page, to return to the MortgageBroker/ProxyService folder page.

This step completes the configuration of the LoanGateway1 proxy service in ALSB Console. Activate the session. For more information, see Table 3-2.

Create the Business Services

In the routing a loan scenario, when the interest rate requested on a loan application is greater than or equal to 5%, then the loan application is routed to the normal loan processing service for approval. If the interest rate requested on a loan application is less than 5%, then the loan application must be approved by a manager, therefore it is routed to a manager approval service.

Complete this step to:

Create the NormalLoan Business Service
  1. In the ALSB console Change Center click Create to create a new session
  2. In the Project Explorer, select the BusinesService folder from the MortgageBroker project tree.
  3. In the Select Resource Type drop-down list, select Business Service.
  4. The Create a Business Service - General Configuration page is displayed as shown in Figure 3-16.

    Figure 3-16 Create Business Service


    Create Business Service

  5. Enter a name for the service. In this case, enter NormalLoan.
  6. For Service Type, select WSDL web service, then click Browse… . Select the WSDL and port on which to base the business service:
    1. In the WSDL Browser, select the normalLoan WSDL
    2. Select the port (helloPort) for the WSDL.
    3. Click Submit.
    4. The text field for the WSDL port service type is populated with the value selected on the Create a Business Service - General Configuration page.

  7. Click Next.
  8. The Create a Business Service - Transport Configuration page is displayed as shown in Figure 3-17.

    Figure 3-17 Transport Configuration of a Business Service


    Transport Configuration of a Business Service

  9. Accept the default protocol, http.
  10. Select none for the Load Balancing Algorithm, since load balancing is relevant only when a service specifies multiple end points.
  11. When you specify multiple end points and a load balancing algorithm, if one end point is overloaded or not available at run time, the message can be sent to the next service in the list of end point URIs. In this case, there is only one service, therefore accepting the default behavior or selecting none does not effect the behavior of the proxy service at run time.

  12. The End Point URI of the business service is the endpoint URI on the server on which the service is deployed. Ensure that the pre-populated value for the End point URI in the Existing URIs field is http://<host:port>/njws_basic_ejb/NormalSimpleBean.
  13. The host and port values specified for <host:port> represent the machine and port on which your ALSB server is running.

    Note: Delete any invalid endpoint URI in the existing URI list.
  14. Accept the default settings for the remaining options on the page and click Next.
  15. The Create a Business Service-HTTP Transport Configuration page is displayed as shown in Figure 3-18.

    Figure 3-18 HTTP Transport Configuration of a Business Service


    HTTP Transport Configuration of a Business Service

  16. Accept the default settings on this page, then click Next.
  17. The Create a Business Service-SOAP Binding Configuration page is displayed as shown in Figure 3-19.

    Figure 3-19 SOAP Binding Configuration of Business Service


    SOAP Binding Configuration of Business Service

  18. Accept the default settings on this page, then click Next.
  19. The Create a Business Service-Summary page is displayed as shown in Figure 3-20. You can now check if all the settings of the business service have been implemented correctly.

    Figure 3-20 Business Service - Configuration Settings Summary


    Business Service - Configuration Settings Summary

  20. Click Save to accept the configuration settings.
  21. To turn on monitoring for the NormalLoan business service, click NormalLoan business service in the Resources pane. The View a Business Service page is displayed as shown in Figure 3-21. The Operational Settings tab on this page has options to enable monitoring for the business service.

    Figure 3-21 View Business Service Page


    View Business Service Page

    To enable monitoring:

    1. Click the Operational Settings tab.
    2. Select the Enable Monitoring check box.
    3. Choose an aggregation interval for the service. The aggregation interval is the period over which aggregated statistics related to the service are computed for display in the ALSB Console dashboard. You can also accept the default value for the Aggregation Interval, which is set to five minutes.
    4. For more information about using the ALSB Dashboard and monitoring services, see Monitoring in Using the AquaLogic Service Bus Console and Monitoring ALSB at Runtime AquaLogic Service Bus Operations Guide.

      Click Update.

    5. Click Back in the View a Business Service page to return your browser to the MortgageBroker project, BusinessService folder page.

You have completed the configuration of the NormalLoan business service on ALSB Console. Activate the session. For more information, see Table 3-2.

Create the ManagerLoanReview Business Service

To create the business service to which a loan application is routed when the interest rate requested in that loan application is less than 5%.

Follow the same tasks as described in the preceding section: Create the NormalLoan Business Service, but use the configuration parameters in the following table.

Table 3-4 ManagerLoanReview Business Service
Configuration Parameter
Value
Business Service Name
ManagerLoanReview
ManagerApprovalService WSDL
Select the managerApproval WSDL you created based on: BEA_HOME\alsb_3.0\samples\servicebus\examples\src\examples\webservices\jws_basic\manager\ManagerApprovalService.wsdl

Note: Select the helloPort port.

EndpointURI
http://<host:port>/mjws_basic_ejb/ManagerSimpleBean
Load Balancing Algorithm
none

Summary

When you complete all the tasks from Prepare the Environment to Create the Business Services, you have created two business services (NormalLoan and ManagerLoanReview), a proxy service (LoanGateway1) and two WSDLs (normalLoan and ManagerApprovalService) that are the resources required for this tutorial.

Once you have configured the proxy service with a base configuration you can proceed to the next task (Configure the LoanGateway1 Proxy Service) to complete the configuration of the proxy service by adding the routing behavior for the loan application.

Configure the LoanGateway1 Proxy Service

ALSB Message Flows define the implementation of proxy services. Message flows can include zero or more pipeline pairs: request and response pipelines for the proxy service (or for the operations on the service) and error handler pipelines that can be defined for stages, pipelines, and proxy services. Pipelines can include one or more stages, which in turn include actions.

Configure the Routing Behavior of the Message Flow
  1. In the ALSB console Change Center click Create to create a new session.
  2. In the Project Explorer, select the ProxyService folder from the MortgageBroker project tree.
  3. Note: You must be in a session to edit resources. If you have not already done so, click Create in the change center to begin a session to configure the proxy service and edit the message flow.
  4. In the Actions column associated with the LoanGateway1 proxy service, double click the Edit Message Flow icon. The Edit Message Flow page for the proxy service LoanGateway1 is displayed as shown in Figure 3-22.
  5. Figure 3-22 Edit Message Flow for LoanGateway1 Proxy Service


    Edit Message Flow for LoanGateway1 Proxy Service

  6. Click LoanGateway1, and select Add Route from the short-cut menu options.
  7. Figure 3-23 Configure Message Flow for LoanGateway1 Proxy Service


    Configure Message Flow for LoanGateway1 Proxy Service

    RouteNode1 is added in the configuration page as shown in Figure 3-24.

    Figure 3-24 Add a Route Node


    Add a Route Node

  8. Click RouteNode1 and select Edit > Route from the short-cut menu options.
  9. The Edit Stage Configuration: Route Node page is displayed as shown in Figure 3-25. This page contains a single Add an Action link.

    Note: A stage is an element of a pipeline and also a container for actions defined in a pipeline. Actions are the elements of a pipeline stage that define the handling of messages as they flow through a proxy service at run time.
    Figure 3-25 Add an Action Link


    Add an Action Link

  10. Click the Add an Action link, and select the Communication > Routing Table from the short-cut menu options.
  11. Figure 3-26 Add a Routing Table Element


    Add a Routing Table Element

    The Edit Stage Configuration page changes to display routing table configuration page.

    Figure 3-27 Routing Table Configuration Page


    Routing Table Configuration Page

    You must configure the routing table to route messages to business services based on the value of the interest rate element in the incoming message. You can configure content-based routing by creating an XQuery expression, using the XQuery Expression Editor.

  12. In the Routing table, click <Expression>. The XQuery Expression Editor is displayed.
  13. Figure 3-28 XQuery Expression Editor


    XQuery Expression Editor

  14. In the left pane, click Variable Structures.
  15. Figure 3-29 Namespace Definitions Pane


    Namespace Definitions Pane

  16. The Variable Structures pane is displayed. Select body from the Select Structure drop-down list in the Variable Structures pane.
  17. Figure 3-30 Variable Structures Pane

    Variable Structures Pane

  18. A structural representation of the body element is displayed in the Variable Structures pane.
  19. Click + to expand the processLoanApp element, within the $body - processLoanApp (request) element.
  20. Figure 3-31 processLoanApp Element


    processLoanApp<span style= Element" id="wp1103797"/>

  21. Click + to expand the loanRequest element. A graphical representation of the structure of the loanRequest document is displayed. At run time, the proxy service makes its routing decision based on the value in the Rate element of the message.
  22. Figure 3-32 loanRequest Element

    loanRequest Element

  23. Drag-and-drop the circle associated with the rate element in the XQuery Expression text box. The following XQuery expression is written in the text box:
  24. $body/exam:processLoanApp/loanRequest/java:Rate
    Note: The drag-and-drop functionality works only in Internet Explorer (IE) browsers. If you are using a browser other than IE, select the Rate element in the Variable Structures pane. The expression is displayed in the Property Inspector palette. Place the cursor in the XQuery expression text box and click Copy Property. The expression is copied to the text box. You can also copy the expression in the palette and paste it in the XQuery Expression text box.
    Figure 3-33 XQuery Expression Editor


    XQuery Expression Editor

  25. Click Validate to validate the XQuery. It is a good practice to do this before you submit the expression. The expression is validated for syntax. If there are errors in the expression, they are displayed directly above the Validate button.
  26. Figure 3-34 XQuery Validation


    XQuery Validation

  27. Click Save. The routing table is displayed on the Edit Stage Configuration page. <Expression> is replaced by the expression that returns the value of the Rate element in the message.
  28. Figure 3-35 Routing Table View - Expression


    Routing Table View - Expression

  29. In the Operator drop-down list, select <. In the associated text field enter the number 5.
  30. The routing table now contains an expression that determines the routing behavior. If the value in the rate element is less than 5, you must route according to the routing table configuration.

    Figure 3-36 Routing Table View - Routing Condition


    Routing Table View - Routing Condition

  31. Click the Service link to define the service to which you want to route messages when the rate is less than five. The Select Service page is displayed.
    1. Select the ManagerLoanReview business service.
    2. Click Submit.
  32. In the Routing Table Operation drop-down list, select the processLoanApp operation. This is the operation on the ManagerLoanReview business service that is invoked at run-time if the rate requested in the loan application is less than 5.

You have now defined the case to route the loan application to the ManagerLoanReview business service. If the rate specified in the loan application is equal to or greater than five percent, then the message is routed to the NormalLoan business service. The next section describes how you can add a condition to the routing table to account for this case (which is the default case).

Add a Default (Else) Condition to the Routing Table
  1. Click the Case icon, then select Insert Default Case. The else condition (default case) is added to the routing table.
  2. Figure 3-37 Routing Table Default Condition


    Routing Table Default Condition

  3. In the Default (else) condition, click the Service link. The Select Service page is displayed.
    1. Select the NormalLoan business service.
    2. Click Submit.
  4. In the Default operation drop-down list, select the processLoanApp operation for the service.
  5. This step completes the configuration of the message flow in the route node: RouteNode1.

    After you have completed these tasks, the Edit Stage Configuration page is displayed as shown in Figure 3-38.

    Figure 3-38 Routing Behavior of the Message Flow
  6. Click Validate to validate the RouteNode1 routing configuration.
  7. Note: It is a good practice to validate any updates to the routing behavior before you save the configuration.
  8. Click Save on the Edit Stage Configuration page to save the configuration and return to the Edit Message Flow page.
  9. Figure 3-39 LoanGateway1 Proxy Service Message Flow Map


    LoanGateway1 Proxy Service Message Flow Map

  10. Click Save on the Edit Message Flow page and return to the MortgageBroker/ProxyServices page.
  11. In the Change Center, click Activate the session. For more information, see Table 3-2.

Summary

Configure the LoanGateway1 Proxy Service completes the configuration of the run-time message routing behavior in the LoanGateway1 Routing Table. A message is routed to the ManagerLoanReview business service if the rate specified in the loan application is less than 5. Otherwise the message is routed to the NormalLoan business service.

Test Your Loan Application Routing Configuration Using the Test Console

After you have configured ALSB to work with the client and the target business services, you can test the configuration. The routing behavior for the proxy service LoanGateway1 in this scenario is based on the interest rate requested in the loan application message. A change in the value of the interest rate results in a change in the routing behavior as follows:

To test the Routing of the Loan Application ManagerLoanReviewService

  1. Start WLS Server in ServiceBusTutorial Domain
  2. In ALSB Console activate the current session.
  3. Click on Resource Browser in the left panel to navigate to Summary of Proxy Services page.
  4. Click on Launch Test Console icon in Actions column for LoanGateway1 to launch the test console (see Figure 3-40).
  5. Figure 3-40 Test Console for LoanGateway1


    Test Console for LoanGateway1

  6. Replace the default payload in loanRequest field with the following code:
  7. <loanRequest xmlns:java="java:normal.client">
        <!--Optional:-->
        <java:Name>Smith</java:Name>
        <!--Optional:-->
        <java:SSN>1234567</java:SSN>
        <!--Optional:-->
        <java:Rate>4.1</java:Rate>
        <!--Optional:-->
        <java:Amount>9000000</java:Amount>
        <!--Optional:-->
        <java:NumOfYear>10</java:NumOfYear>
        <!--Optional:-->
        <java:Notes>Manager Loan Application Review Service</java:Notes>
    </loanRequest>
  8. Accept other default settings and click Execute. The response as in Figure 3-41 is obtained.
  9. Figure 3-41 Response from the ManagerLoanApplicationReview Service


    Response from the ManagerLoanApplicationReview Service

The response message indicates that the proxy service LoanGateway1 routes the request to ManagerLoanReview business service because the interest rate requested is 4 (less than 5).

To test the Routing of the Loan Application Through normalLoanProcessor

  1. Start WLS Server in ServiceBusTutorial Domain
  2. In ALSB Console activate the current session.
  3. Click on Resource Browser in the left panel to navigate to Summary of Proxy Services page.
  4. Click on Launch Test Console icon in Actions column for LoanGateway1 to launch the test console (see Figure 3-40)
  5. Replace the default payload in loanRequest field with the following code:
  6. <loanRequest xmlns:java="java:normal.client">
        <!--Optional:-->
        <java:Name>Smith</java:Name>
        <!--Optional:-->
        <java:SSN>1234567</java:SSN>
        <!--Optional:-->
        <java:Rate>5.3</java:Rate>
        <!--Optional:-->
        <java:Amount>9000000</java:Amount>
        <!--Optional:-->
        <java:NumOfYear>10</java:NumOfYear>
        <!--Optional:-->
        <java:Notes>Manager Loan</java:Notes>
    </loanRequest>

Accept other default settings and click Execute. The response as in Figure 3-42 is obtained.

Figure 3-42 Response From NormalLoanProcessor

Response From NormalLoanProcessor

The response message indicates that the proxy service LoanGateway1 routes the request to NormalLoanProcessor business service because the interest rate requested is 5.3(greater than 5).

Where to go From Here

After completing Tutorial 1. Routing a Loan Application proceed to Tutorial 2. Transforming a Loan Application.


  Back to Top       Previous  Next