Skip navigation.

Tutorials

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

Tutorial 1. Routing a Loan Application

BEA AquaLogic Service Bus enables message routing between business services in the enterprise environment. Messages can be routed from a client through the AquaLogic Service Bus intermediary, to the appropriate business service. BEA AquaLogic Service Bus routes messages to one or more destinations based on the actions taken on the messages. You configure those actions using the AquaLogic Service Bus Console. Routing provides an efficient alternative to building a multitude of point-to-point Web services connections between pairs of systems.

This section includes the following topics:

 


Prerequisites

Complete Setting Up the Tutorials.

 


Tutorial Goals

The goal of the tutorial is to provide the steps to create and test a routing scenario developed using the graphical environment provided in AquaLogic Service Bus Console. It includes the following:

Features Highlighted

Developing this tutorial exposes you to the following features of BEA AquaLogic Service Bus:

 


Definition of the Scenario

A primary mortgage company uses BEA AquaLogic Service Bus 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 another business service for processing. The target business service responds indicating whether the loan application is approved or rejected.

The following figure summarizes the logical architecture to support this scenario. It illustrates where BEA AquaLogic Service Bus fits in your enterprise to mediate the messaging between the clients and the business services for the routing scenario.

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

Expose a Loan Application Request Web Service via AquaLogic Service Bus


 

Overview of the Run-Time Process in AquaLogic Service Bus

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 request is routed to the managerLoanReviewService business service, otherwise it is routed to the NormalLoan business service. The target business service returns a response message similar to the following message:

Loan Application Response: APPROVED BY THE <i><b>NORMAL</b></i> LOAN APPLICATION REVIEW SERVICE. 

Note: NORMAL is replaced with MANAGER when the managerLoanReviewService business service is used at run-time.

Required Resources

The following table lists the resources required to develop and run the Routing a Loan Application tutorial.

Table 3-1 Routing Loan Application Tutorial Resources

Resource Name

Description

normalLoan

This is the WSDL resource

NormalLoan Web service

This is an external business service used by AquaLogic Service Bus

managerLoanReviewService Web service

This is an external business service used by AquaLogic Service Bus

LoanGateway1

This is the AquaLogic Service Bus proxy service


 

 


Steps in This Tutorial

In this tutorial, BEA AquaLogic Service Bus is used to route a loan application within a Mortgage company to a target a Web service depending on the interest rate requested.

Complete the following steps to design and configure the proxy service and the associated resources in AquaLogic Service Bus to resolve this user case scenario:

Step 1: Prepare Your Environment

Ensure that AquaLogic Service Bus is running in the domain you created for the tutorial and that you have completed the steps described in Setting Up the Tutorials.

Step 2: Create a Session and Set up a Project

You must first start a session in the AquaLogic Service Bus Console. You can view resources and configurations in the AquaLogic Service Bus Console without being in a session, but to edit, change, or delete items or properties in a project, you must be in an active session. The Change Center manages sessions in the console as shown in the following figure. Sessions are saved as temporary files until the session is activated.

Figure 3-2 Manage Sessions Using Change Center

Manage Sessions Using Change Center


 

The following table provides a summary of the Change Center functionality.

Table 3-2 Description of the Change Center

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 reenter 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.

Exit

Discontinue the session and save the session state.

You can reenter the discontinued session by clicking Edit.

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 active 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 good practice to save your configuration changes incrementally.

It is recommended that whenever you change a configuration in the console that you click Create before making any changes and that you click Activate when you have completed your changes to the configuration.

Create the MortgageBroker Project and File Folders

This section describes how to create a MortgageBroker project under the Projects folder in the AquaLogic Service Bus Console. For this scenario, you will also create three folders in the MortgageBroker project—to hold each of the resource types to be defined for the project:

Note: In the AquaLogic Service Bus Console, you can add new projects and navigate the project trees using the Project Explorer. Project folders can be collapsed and expanded as necessary. All project configurations are performed in the project page. Selecting a project or one of its sub-folders from the Project Explorer displays the information for that entity on the project page.

To Start a Session and Create a Project

  1. Click Create in the Change Center to create a new session.
  2. In the AquaLogic Service Bus Console navigation panel, select Project Explorer.
  3. The Project Explorer pane is opened in the navigation panel and a project page is displayed in the console.

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

    Create a Project


     
  6. Click Add Project.

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

You will create the WSDL folder 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 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 the following figure.
  3. Figure 3-4 Create a Folder

    Create a Folder


     
  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 (see Table 3-2).

Step 3: Create the WSDL Resources

AquaLogic Service Bus 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.

Create the normalLoan Service WSDL Resource

The WSDL defines the public contract (interface specification) between a client and a service, whether the service is a proxy service or 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 as subsequent service registration steps depend on it. The WSDL is subsequently used to register the business service to create the proxy service.

To Import a WSDL

  1. Click Create in the Change Center to create a new session.
  2. In the AquaLogic Service Bus Console navigation panel, select Project Explorer.
  3. In Project Explorer, click MortgageBroker to expand the folder, then click WSDL to open the WSDL folder.
  4. In the Resources panel, from the Select Resource Type drop-down list, select WSDL.
  5. Figure 3-5 Select a Resource Type

    Select a Resource Type


     

    A page that allows you to create a new WSDL resource is displayed as shown in Figure 3-6.

  6. Enter the following information in the Create a New WSDL Resource page:
    1. Enter the resource name normalLoan.
    2. Browse to the location of the WSDL associated with the normal loan process:
    3. BEA_HOME\weblogic91\samples\servicebus\examples\src\examples\webservices\jws_basic\normal\NormalLoanApprovalService.wsdl
    4. You can optionally enter information in the Resource Description text box to document the resource.
    5. Figure 3-6 Create a WSDL Resource

      Create a WSDL Resource


       
    6. Click Save to create the WSDL resource.
    7. The resource is now displayed in the resources panel.

This step completes the creation of a WSDL resource, normalLoan, in the WSDL folder.

Create the ManagerApproval Service WSDL Resource

Import the WSDL associated with the ManagerApproval Service. Use the procedure To Import a WSDL to do this using the following parameters.

Table 3-3 ManagerApproval Service WSDL

Configuration Parameter

Value

Resource Name

managerApproval

ManagerApprovalService WSDL

BEA_HOME\weblogic91\servicebus\examples\src\examples\webservices\jws_basic\manager\ManagerApprovalService.wsdl


 

Step 4: Create a Proxy Service

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

To Create the Proxy Service

  1. In Project Explorer, select the MortgageBroker project. The project folder is expanded to show the directory structure of the project.
  2. Select the ProxyService folder. The MortgageBroker/ProxyService page is displayed.
  3. In the Select Resource Type drop-down list, select Proxy Service.
  4. The Edit a Proxy Service - General Configuration page is displayed as shown in Figure 3-8.

  5. Name the proxy service, LoanGateway1.
  6. In Service Type, click WSDL port, then click Browse.
  7. The Select a WSDL browser window is displayed. The proxy service is based on the WSDL resource you originally created, hence you must reference the resource here.

  8. In the Select a WSDL window, select the normalLoan WSDL.
  9. The WSDL Definitions panel is populated with the content categories of the WSDL.

    1. In the Definitions panel, from the Ports category, select the WSDL port for this WSDL (helloPort).
    2. Click Submit to complete your selection.
    3. Figure 3-7 Select WSDL Definition

      Select WSDL Definition


       

    The WSDL port text field is populated with the port name as shown in the following figure.

    Figure 3-8 Create Proxy Service

    Create Proxy Service


     
  10. Click Next to continue the configuration.
  11. The Edit a Proxy Service - Transport Configuration page is displayed.

    Figure 3-9 Transport Configuration of Proxy Service

    Transport Configuration of 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. HTTP is the default protocol as it is the assumed protocol of 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.
  16. Click Next.
  17. The Edit a Proxy Service - HTTP Transport Configuration page is displayed.

    Figure 3-10 HTTP Transport Configuration of Proxy Service

    HTTP Transport Configuration of Proxy Service


     

    Because a security policy has not been defined for the Web service, you do not need to change configuration settings on this page.

  18. Click Next to accept the default settings for the HTTP transport configuration.
  19. The Edit a Proxy Service - Operation Selection Configuration page is displayed.

    Figure 3-11 Operation Selection Configuration of Proxy Service

    Operation Selection Configuration of Proxy Service


     
  20. Accept the default SOAP Body Type selection algorithm.
  21. On this page you are selecting the metadata accompanying the message that identifies which Web service operation to invoke.

    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 more than one method is accessible to a client (that is, there are multiple public methods), then 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. Note that the SOAP header can also specify the operation—by convention however, the SOAP body does it.

  22. Click Next.
  23. A summary of the configuration settings for the proxy service is displayed.

    Figure 3-12 Proxy Service - Configuration Settings Summary

    Proxy Service - Configuration Settings Summary


     

    You can review the configuration settings and change them, if necessary, before registering the proxy service.

  24. When satisfied with the proxy service configuration settings, click Save to register the service.
  25. Note: You must always select Save prior to activating a session configuration in the Change Center.

    The LoanGateway1 proxy service is displayed in the Resources panel in the MortgageBroker project, ProxyService folder.

  26. If you want to turn on monitoring for the LoanGateway1 proxy service, click the Manage Monitoring icon Proxy Service - Configuration Settings Summary associated with the LoanGateway1 proxy service in the Resources panel.
  27. The Monitoring Configuration page, which you can use to enable monitoring for this service, is displayed.

    Figure 3-13 Monitoring Configuration of Proxy Service

    Monitoring Configuration of Proxy Service


     

    To enable monitoring:

    1. Select the Enable Monitoring check box.
    2. Enter an aggregation interval for the service. This interval is the period over which aggregated statistics related to the service are computed for display in the AquaLogic Service Bus Console, specifically the Dashboard.
    3. For more information about using the AquaLogic Service Bus Dashboard and monitoring services, see:
      - Monitoring in the AquaLogic Service Bus Console Online Help and
      - Monitoring in the BEA AquaLogic Service Bus User Guide.

    4. Click Update.
    5. Click Back in the Monitoring Configuration page, to return your browser to the MortgageBroker project, ProxyService folder page.

This step completes the configuration of the LoanGateway1 proxy service in the AquaLogic Service Bus Console.

Step 5: 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 manger and is therefore routed to a manager approval service.

In this step, you will define the normal loan processing and manager approval business services:

To Create the Normal Loan Business Service

  1. In Project Explorer, select the BusinesService folder from the MortgageBroker project tree.
  2. Note: If the folders are not displayed in the project tree, click Activate, then Submit to register the changes in the session. The folders you created for the MortgageBroker project are displayed. Click Create to make changes to the session.

  3. In the Select Resource Type drop-down list, select Business Service.
  4. The Edit a Business Service - General Configuration page is displayed.

    Figure 3-14 Create Business Service

    Create Business Service


     
  5. Enter a name for the service. In this case, enter NormalLoan.
  6. For Service Type, select WSDL port, then click Browse to locate 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.

    The text field for the WSDL port service type is populated with the value selected.

  7. Click Next.
  8. The Edit a Business Service - Transport Configuration page is displayed.

    Figure 3-15 Transport Configuration of Business Service

    Transport Configuration of Business Service


     
  9. Accept the default protocol, HTTP.
  10. For the Load balancing Algorithm, select none because load balancing is relevant only when a service specifies multiple end points.
  11. In the case that multiple endpoints and a load balancing algorithm are specified, if one endpoint is overloaded or not available at run time, the message can be dispatched to the next service in the list of endpoint 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. Ensure that the pre-populated value for the Endpoint URI in the Existing URIs field is http://host:port/njws_basic_ejb/NormalSimpleBean
  13. where host:port represents the machine and port on which your AquaLogic Service Bus server is running. The host and port values must be the same as the values specified in BEA_HOME\weblogic91\samples\servicebus\examples\src\examples.properties

    For more information, see Edit the examples.properties File.

    The Endpoint URI of the business service is the endpoint URI on the server on which the service is deployed.

    Note: Delete any other invalid endpoint URI in the Existing URIs list.

  14. Accept the default settings for the remaining options on the page and click Next.
  15. The Edit a Business Service—HTTP Transport Configuration page is displayed.

    Figure 3-16 HTTP Transport Configuration of Business Service

    HTTP Transport Configuration of Business Service


     
  16. Accept the default settings on this page, then click Next.
  17. The Edit a Business Service—SOAP Binding Configuration page is displayed.

    Figure 3-17 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 Edit a Business Service—Summary page is displayed. You can now review the business service to check that you implemented it correctly.

    Figure 3-18 Business Service - Configuration Settings Summary

    Business Service - Configuration Settings Summary


     
  20. Click Save to accept the configuration settings.
  21. If you want to turn on monitoring for the NormalLoan business service, click the Manage Monitoring icon Business Service - Configuration Settings Summary associated with the NormalLoan business service in the Resources panel.
  22. The Monitoring Configuration page, which you can use to enable monitoring for this service, is displayed. To enable monitoring:

    1. Select the Enable Monitoring check box.
    2. Enter an aggregation interval—the period over which aggregated statistics related to the service are computed for display in the AquaLogic Service Bus Console, specifically the Dashboard.
    3. For more information about using the AquaLogic Service Bus Dashboard and monitoring services, see:
      - Monitoring in the AquaLogic Service Bus Console Online Help and
      - Monitoring in the BEA AquaLogic Service Bus User Guide.

    4. Click Update.
    5. Click Back in the Monitoring Configuration page to return your browser to the MortgageBroker project, BusinessService folder page.

This step completes the configuration of the NormalLoan business service in the AquaLogic Service Bus Console.

To Create the managerLoanReviewService Business Service

This section describes how to create the business service to which a loan application is routed in the case that the interest rate requested in that loan application is less than 5%.

Follow the same steps as described in the preceding section: To Create the Normal Loan Business Service, but use the configuration parameters in the following table.

Table 3-4 ManagerLoanReviewService Business Service

Configuration Parameter

Value

Business Service Name

managerLoanReviewService

ManagerApprovalService WSDL

Select the managerApproval WSDL you created based on: BEA_HOME\weblogic91\servicebus\examples\src\examples\webservices\jws_basic\manager\ManagerApprovalService.wsdl

Note: Select the helloPort port.

EndpointURI

http://host:port/mjws_basic_ejb/ManagerSimpleBean


 

Summary

By completing Step 1: Prepare Your Environment to Step 5: Create the Business Services, you created two business services (NormalLoan and managerLoanReviewService), a proxy service (LoanGateway1) and a WSDL (normalLoan) as resources required for the tutorial scenario.

You configured the proxy service with a base configuration. The next step (Step 6: Configure the LoanGateway1 Proxy Service) describes how to complete the configuration of the proxy service to add the routing behavior for the loan application.

Step 6: Configure the LoanGateway1 Proxy Service

AquaLogic Service Bus 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. To configure the routing behavior of the LoanGateway1 proxy service, you will complete the following for the message flow:

To Configure the Routing Behavior of the Message Flow

  1. In Project Explorer, select the ProxyService folder from the MortgageBroker project tree.
  2. Note: You must be in a session to edit resources. If you have not already done so, begin a session (click Create in the Change Center) so that you can configure the proxy service and edit the message flow.

  3. In the Actions column associated with the LoanGateway1 proxy service, click the Edit Message Flow icon Business Service - Configuration Settings Summary .
  4. The Edit Message Flow page for the proxy service LoanGateway1 is displayed.

    Figure 3-19 Configure Message Flow for LoanGateway1 Proxy Service

    Configure Message Flow for LoanGateway1 Proxy Service


     
  5. Click LoanGateway1, then select Add Route Node.
  6. In the configuration dialog, RouteNode1 is added.

    Figure 3-20 Add Route Node

    Add Route Node


     
  7. Click RouteNode1 and from the pop-up menu select Edit—>Route Node.
  8. The Edit Stage Configuration page is displayed. The page contains a single link, Add an Action.

    A stage is an element of a pipeline and it is 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.

  9. Click Add an Action, then select Routing Table.
  10. The Edit Stage Configuration page changes to display routing table configuration page.

    You will configure the routing table to route messages to business services based on evaluating the interest rate element of the incoming message. You must create an XQuery expression to do this. You can do so using the XQuery Expression Editor.

  11. In the Routing table, click <Expression>. The XQuery Expression Editor page is displayed.
  12. Accept the default selection of XQuery Text in the page.
  13. Click Variable Structures. The Variable Structures pane is displayed.
  14. From the Select Structure drop-down list in the Variable Structures pane, select body.
  15. A structural representation of the body element is displayed in the Variable Structures pane.

    1. Click + beside the processLoanApp element to expand the element.
    2. The processLoanApp element is within the $body - processLoanApp (request) element.

    3. Click + to expand the loan request element.
    4. A graphical representation of the structure of the loan request document is displayed.

      At run time, the proxy service makes its routing decision based on the value in the rate element of the message.

    5. Select the circle icon Add Route Node associated with the Rate node element, drag and drop it in the XQuery Expression text box.
    6. The $body/exam:processLoanApp/loanRequest/java:Rate XQuery expression is written in the text box.

      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 into the XQuery Expression text box.

      Figure 3-21 XQuery Expression Editor

      XQuery Expression Editor


       
  16. Click Validate to validate the XQuery.
  17. It is 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. In this case, the expression is valid.

  18. Click Save.
  19. You are returned to the routing table on the Edit Stage Configuration page. <Expression> is replaced by the expression that returns the value of the rate element in the message.

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

  23. 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 browser window is displayed.
    1. Select the managerLoanReviewService business service.
    2. Click Submit.
  24. In the Routing Table Operation menu, select the processLoanApp operation. This is the operation on the managerLoanReviewService business service that is invoked at run time if the rate requested in the loan request is less than 5.

You have now defined the case for routing the loan application to the managerLoanReviewService 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 to add a condition to the routing table to account for this case (the default case).

To Add a Default (Else) Condition to the Routing Table

  1. Click the Case icon XQuery Expression Editor , then select Insert Default Case. The else condition is added to the routing table.
  2. In the else condition, click the Service link. The Select Service browser window is displayed.
    1. Select the NormalLoan business service.
    2. Click Submit.
  3. Select the processLoanApp operation for the service.

This step completes the configuration of the message flow in the route node: RouteNode1.

After completing the above steps, the Edit Stage Configuration page should look like the following figure.

Figure 3-22 Routing Behavior of the Message Flow

Routing Behavior of the Message Flow


 
  1. Click Save on the Edit Stage Configuration page to save the configuration. You are returned to the Edit Message Flow page.
  2. Click Save. You are returned to the MortgageBroker/ProxyServices page.
  3. In the Change Center, click Activate, then Submit to save the session and to instantiate all the configuration changes made during the session.

You can view the map of the message flow of the proxy service as shown in the following figure.

Figure 3-23 Map of Message Flow of the LoanGateway1 Proxy Service

Map of Message Flow of the LoanGateway1 Proxy Service


 

Summary

By completing Step 6: Configure the LoanGateway1 Proxy Service, you have completed the configuration of the logic in the Routing Table that determines the run-time routing behavior for messages. A message is routed to the managerLoanReviewService business service if the rate specified in the loan application is less than five, otherwise the message is routed to the normalLoan business service.

Step 7: Test Your Loan Application Routing Configuration

Now that you have configured BEA AquaLogic Service Bus to work with the client and the target business services, you can test the configuration. Testing is done on the command line by changing the value of the interest rate field in the build.xml file and then running ant. The routing behavior for the proxy service in this scenario is based on the interest rate requested in the loan application message. Changing the value of the interest rate changes the routing behavior:

This section describes how to test the proxy service for both cases. The message returned in the Command window after running a test indicates the success or failure of the test and identifies the business service that processed the request.

This section includes the following test scenarios:

To run this test correctly, ensure that WebLogic Server is started in the BEA AquaLogic Service Bus 2.1 (ServiceBusTutorial) domain.

To test the managerLoanReviewService Business Service

  1. Open a Command window.
  2. If you have not run the setEnv.cmd to set up your environment, you must do so now.
    1. Change to the following directory:
    2. BEA_HOME\weblogic91\samples\servicebus\examples\src\ 
    3. In this directory, on the command line, run the following command:
    4. setEnv.cmd

      Note: If you are testing the configuration on a UNIX system, run the setEnv.sh script at your command line prompt.

  3. Change to the following directory:
  4. BEA_HOME\weblogic91\samples\servicebus\examples\src\examples\webservices\jws_basic\normal
  5. To test the routing behavior of the proxy service, you must edit the build.xml file run target:
    1. Open build.xml.
    2. Scroll to the end of the build.xml file looking for the string:
    3. <arg line="http://$... 
    4. Replace the string found at this location with the following string and save the file.
    5. <arg line="http://${wls.hostname}:${wls.port}/loan/gateway1 steve 555 2500 20 4.9 notes" />

    This changes the URI to that of the proxy service running in the tutorial domain, and specifies a value of 4.9 for the interest rate.

    The remainder of the input parameters specified on the arg line are described in the following table.

    Table 3-5 Input Parameters

    steve

    a single string representing the client name

    555

    the client ID

    2500

    the requested loan amount

    20

    the duration of the loan

    4.9

    the requested interest rate

    notes

    a string that can contain miscellaneous notes


     
  6. Ensure that the business services are deployed:
    1. In the command window, change to the following directory:
    2. cd BEA_HOME\weblogic91\samples\servicebus\examples\src\examples\webservices\jws_basic\normal 
    3. Enter ant, then press Enter. The BUILD SUCCESSFUL message should appear as output.
  7. To run the test, on the command line, enter:
  8. ant run 

    This tests the routing logic of the proxy service. A response message from the Web service is output to the command line.

    [java] Loan Application Response: APPROVED BY THE <i><b>MANAGER</b></i> LOAN APPLICATION REVIEW SERVICE
         [java] Rate: 4.9
    BUILD SUCCESSFUL

The response message indicates that the Manager Loan Application Processing Service processed the request because the interest rate requested was 4.9 (less than 5.0).

To Test the normalLoan Business Service

  1. Follow the procedure To test the managerLoanReviewService Business Service to edit the build.xml file in the following directory:
  2. BEA_HOME\weblogic91\samples\servicebus\examples\src\examples\webservices\jws_basic\normal

    Note: In this case (to test the normalLoan business service), enter a value of 5.1 for the interest rate in the build.xml file (see Table 3-5), then save the changes.

  3. If you have not already done so, deploy the business services:
    1. In a command window, change to the following directory:
    2. BEA_HOME\weblogic91\samples\servicebus\examples\src\examples\webservices\jws_basic\normal 
    3. Enter ant, then press Enter. The BUILD SUCCESSFUL message should appear as output.
  4. To test the routing logic of the proxy service, on the command line, enter:
  5. ant run

    A response message from the Web service is output to the command line.

    [java] Loan Application Response: APPROVED BY THE <i><b>NORMAL</i></b> LOAN APPLICATION PROCESSING SERVICE
         [java] Rate: 5.1
    BUILD SUCCESSFUL

The response message indicates that the Normal Loan Application Processing Service processed the request because the interest rate requested was 5.1.

 

Skip navigation bar  Back to Top Previous Next