Tutorials

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

Tutorial 2. Transforming a Loan Application

Data transformation is the mapping of data from one format to another. This section describes how BEA AquaLogic Service Bus routes and transforms messages, when necessary, according to specific configurations for a proxy service.

This section includes the following topics:

 


Prerequisites

Complete Tutorial 1. Routing a Loan Application.

 


Tutorial Objectives

The tutorial provides the steps to create and test a routing and transformation scenario developed using the graphical environment provided in AquaLogic Service Bus Console.

Using the AquaLogic Service Bus Console you will build on what you learned in Tutorial 1. Routing a Loan Application, to:

 


Definition of the Scenario

A primary mortgage company uses AquaLogic Service Bus to identify and re-route loan applications that can be sold to secondary loan companies. Loan applications with a principal request of greater than US$ 25 million are candidates for sale to a secondary loan company. When AquaLogic Service Bus receives a loan application meeting these criteria, the applicant's credit rating information is retrieved (by making a callout to a Web Service). The credit rating information is added to the loan application, then the application is forwarded to the secondary mortgage company Web Service to be processed.

Loan applications with a principal request equal to or less than US$ 25 million are routed to a different business service for processing.

The target business services respond indicating whether the loan application is approved or rejected.

Figure 4-1 illustrates where AquaLogic Service Bus fits in your enterprise to mediate the messaging between the enterprise services and the business services.

Figure 4-1 Expose a Loan Application Processing Web Service via AquaLogic Service Bus

Expose a Loan Application Processing Web Service via AquaLogic Service Bus

Overview of the Run Time Process in AquaLogic Service Bus

A primary mortgage company receives a loan application. It is routed through the AquaLogic Service Bus proxy service, LoanGateway2, to determine the target business service to process the application. If the loan amount is greater than US$ 25 million, the application is routed to the LoanSaleProcessor business service. If the amount is less than or equal to US$ 25 million, the application is routed to the NormalLoan business service. When the loan amount is more than US$ 25 million, the request pipeline makes a service callout to the CreditRatingService and receives the credit rating of the applicant using the $creditRating variable. To fulfill the interface requirements of the secondary loan company service, the message body is transformed by adding the credit rating details. The transformed message ($body) is routed to a business service that handles applications for large loan amounts. The service returns a response similar to the following:

Loan Application Response: CREDIT RATING: AA: LOAN PURCHASED BY THE <i><b>LARGE</b></i> LOANS SERVICE

Required Resources

You will use the Project folder, MortgageBroker, and the directory structure you created in the previous tutorial to hold the project artifacts. The resources required for this scenario are described in Table 4-1.

Table 4-1 Routing a Loan Application Tutorial Resources
Resource Name
Description
CreditRatingService, LoanSale
These are the WSDL resources
NormalLoan, LoanSaleProcessor, CreditRatingService
These are the external business services used by AquaLogic Service Bus
LoanGateway2
This is the AquaLogic Service Bus proxy service

 


Steps in This Tutorial

In this tutorial, you will:

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

Step 1: Prepare the Environment

Ensure that AquaLogic Service Bus is running in the domain that you created for the tutorial and that you have completed the steps described in Tutorial 1. Routing a Loan Application.

Step 2: Create a Session and Set up a Project

For this tutorial, you need to use the MortgageBroker project folder, and the directory structure that you created in Tutorial 1. Routing a Loan Application to hold the project artifacts.

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

  4. In Project Explorer, expand the MortgageBroker project tree to expose the sub folders containing the project artifacts:
    • ProxyService
    • BusinessServices
    • WSDL

Step 3: Create the Resources

In this step, you will import the WSDL resource, and create the proxy service and the business services required for the tutorial:

Create the WSDL Resources

You must create the WSDL resources (LoanSale and CreditRatingService) before creating the other resources required for this scenario since WSDLs are the base on which you create the business and proxy services.

To import the appropriate WSDLs and create the WSDL resources, follow the steps described in To Import a WSDL, but for this instance, name your resources and base them on the WSDLs as described in Table 4-2.

Table 4-2 WSDL Configuration Settings
Resource Name
Location of the WSDL
LoanSale

BEA_HOME\weblogic92\servicebus\examples\src\examples\webservices\jws_basic\large\LargeLoanPurchasingService.wsdl

CreditRatingService

BEA_HOME\weblogic92\servicebus\examples\src\examples\webservices\jws_basic\credit\CreditLoanApprovalService.wsdl

When you complete this step, the MortgageBroker/WSDL folder contains the WSDL resources created in this tutorial and in Tutorial 1. Routing a Loan Application as in Figure 4-2.

Figure 4-2 WSDL Resources

WSDL Resources

Create a Proxy Service

In this step, you will create a proxy service. The proxy service is used to route the loan application to the appropriate business service. It also calls a look up service to obtain the credit rating of the requestor if the loan amount requested is greater than US$ 25 million.

Note: No units are assigned to the loan amount, but units can be any currency such as US Dollars.

To create a new proxy service, follow the steps described in To Create the Proxy Service, but for this instance, use the proxy service name and the Endpoint URI described in Table 4-3.

Table 4-3 Proxy Service Configuration Settings
Proxy Service Name
LoanGateway2
Service Type
Select the WSDL Web Service (port or binding) option.
Select the normalLoan WSDL in the Select a WSDL browser window.
Select the helloPort port in the Select a WSDL Definition page.
Endpoint URI
Click Next to proceed to the Create a Proxy Service - Transport Configuration page.
Enter /loan/gateway2 as the endpoint URI.

After you complete this step, a summary of the configuration settings for the proxy service is displayed as in the following Figure 4-3. Review the configuration settings prior to registering the proxy service.

Figure 4-3 LoadGateway2 Proxy Service - Configuration Settings Summary

LoadGateway2 Proxy Service - Configuration Settings Summary

When you complete this step, the MortgageBroker/ProxyService folder contains the proxy services that you created in this tutorial and in Tutorial 1. Routing a Loan Application as in Figure 4-4.

Figure 4-4 Proxy Service Resources

Proxy Service Resources

Create a Business Service

In this scenario, the proxy service is configured to route to one of several different business services, depending on the business requirements as follows:

You created the Normal Loan service in Tutorial 1. Routing a Loan Application. To create the LoanSaleProcessor and CreditRatingService business services for this scenario, follow the steps described in Create the NormalLoan Business Service. However, in this case, configure your services using the names, service types, and endpoint URIs described in Table 4-4 and Table 4-5:

Table 4-4 Configuration Settings for the LoanSaleProcessor Business Service
Business Service Name
LoanSaleProcessor
Service Type
Select the WSDL port option.
Select the LoanSale WSDL in the Select a WSDL browser window.
Select the helloPort port in the Select a WSDL Definition page.
Endpoint URI
Ensure that the pre-populated value for the Endpoint URI in the Existing URIs field is http://<host:port>/ljws_basic_ejb/LargeSimpleBean
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\weblogic92\samples\servicebus\examples\src\examples.properties
For more information, see Edit the examples.properties File.

Table 4-5 Configuration Settings for the CreditRatingService Business Service
Business Service Name
CreditRatingService
Service Type
Select the WSDL port option.
Select the creditRatingService WSDL in the Select a WSDL browser window.
Select the helloPort port in the Select a WSDL Definition page.
Endpoint URI
Ensure that the pre-populated value for the endpoint URI in the Existing URIs field is http://<host:port>/crejws_basic_ejb/CreditSimpleBean
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\weblogic92\samples\servicebus\examples\src\examples.properties
For more information, see Edit the examples.properties File.

When you complete this step, the MortgageBroker/BusinessService folder contains the business services that you created in this tutorial and in Tutorial 1. Routing a Loan Application as in Figure 4-5.

Figure 4-5 Business Service Resources

Business Service Resources

Summary

The resources required for this scenario are created when you complete Step 1: Prepare the Environment to Step 3: Create the Resources. You have also configured the proxy service with a base configuration. Step 4: Configure the Routing for the LoanGateway2 Proxy Service to Step 6: Configure the Routing Table Response Actions for the LoanGateway2 Proxy Service describe how to complete the configuration of the proxy service to add the routing, transformation, and Service Callout behavior for the loan application messages.

Step 4: Configure the Routing for the LoanGateway2 Proxy Service

A proxy service is implemented in AquaLogic Service Bus as a message flow, which includes request and response pipelines. This step includes the following tasks:

Create a Routing Table

  1. In the AquaLogic Service Bus Console navigation pane, select Resource Browser.
  2. The Resource Browser pane is opened in the navigation pane and the Summary of Proxy Services page is displayed in the console.

    Note: You must be in a session to edit resources.
  3. In the Actions column associated with the LoanGateway2 proxy service, click the Edit Message Flow icon Business Service Resources.
  4. The Edit Message Flow page for the proxy service LoanGateway2 is displayed.

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

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

  9. Click Add an Action, then select CommunucationArrow symbolRouting Table from the pop-up menu.
  10. The Edit Stage Configuration page changes to display the routing table configuration information.

    To configure the routing table to route messages to business services based on evaluating the amount element of the incoming message, you must create an XQuery expression using the XQuery Expression Editor.

Configure the Routing Expression

  1. In the Routing table, click the <Expression> link. The XQuery Expression Editor page is displayed.
  2. Accept the default selection of XQuery Text in the page.
  3. Click Variable Structures to display the Variable Structures pane.
  4. Select body from the Select Structure drop-down list in the Variable Structures pane. A structural representation of the body element is displayed in the Variable Structures pane.
    1. Click + beside the processLoanApp element to expand the element. The processLoanApp element is within the $body - processLoanApp (request) element.
    2. Click + to expand the loan request element.
    3. The structure of the loan request document is displayed.

      Note: At run time, the proxy service makes its routing decision based on the value in the amount element of the message.
    4. Click the circle icon Business Service Resourcesassociated with the Amount node element, drag and drop it in the XQuery Expression text box.
    5. The $body/exam:processLoanApp/loanRequest/java:Amount 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 Amount 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.
  5. Click Validate to validate the XQuery.
  6. 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 as in Figure 4-6.

    Figure 4-6 Validate Routing Expression


    Validate Routing Expression

  7. Click Save.
  8. The routing table is displayed on the Edit Stage Configuration page. <Expression> is now replaced by the expression that returns the value of the amount element in the message.

  9. In the Operator drop-down list, select > and in the associated text field, enter the number 25000000 (without commas).
  10. The routing table now contains an expression that determines the routing behavior. If the value in the Amount field is greater than US$ 25 million, then messages are routed according to the routing table configuration.

  11. Click the Service link to define the service to which you want to route when the amount is greater than US$ 25 million. The Select Service browser window is displayed.
    1. Select the LoanSaleProcessor business service
    2. Click Submit.
  12. In the Operation drop-down list, select the processLoanApp operation.
  13. This is the operation on the LoanSaleProcessor service business service that is invoked at run time if the amount of the loan requested in the loan application is greater than US$ 25 million.

You have now defined the case for routing the loan application to the LoanSaleProcessor business service as in Figure 4-7.

Figure 4-7 Routing the Loan Application to LoanSaleProcessor

Routing the Loan Application to LoanSaleProcessor

When a loan application with the amount of the loan greater than US$ 25 million is identified, a Web Service callout (Service Callout) is performed to retrieve the customer's credit rating. The credit rating information is added to the loan application and the application is then forwarded to the secondary mortgage company's business service to be processed. Step 5: Configure the Routing Table Request Actions for the LoanGateway2 Proxy Service describes how to configure the proxy service to do the Service Callout and transform the message appropriately for the target service.

Step 5: Configure the Routing Table Request Actions for the LoanGateway2 Proxy Service

Execute the following steps to configure the Routing Table Request actions:

Configure the Service Callout Input Parameter

A Service Callout is used to send the loan application to the CreditRatingService business service, which returns the credit rating of an applicant. Before configuring the Service Callout action, you must assign an input parameter for the Service Callout action as follows:

  1. Open the Edit Stage Configuration page for the routing table that you created in Step 4: Configure the Routing for the LoanGateway2 Proxy Service in the AquaLogic Service Bus Console.
  2. In the Request Actions pane of the Routing Table, click Add an Action, then select Message ProcessingArrow symbolAssign.
  3. The Assign action is added to the Request Action pipeline in the Routing Table.

  4. Click the <Expression> link. The XQuery Expression Editor page is displayed.
    1. Accept the default selection of XQuery Text in the page.
    2. Select body from the Variables Structures drop-down list in the Variables Structures pane, then expand the element list and drag the loanRequest element and drop it into the XQuery expression text box. The XQuery expression is written in the text box:
    3. $body/exam:processLoanApp/loanRequest
    4. Click Validate to validate the XQuery, then Save.
    5. The routing table is displayed on the Edit Stage Configuration page. <Expression> is now replaced by the expression that returns the content of the message to be sent to the Service Callout service.

  5. Enter inputparam in the variable text box as in Figure 4-8.
  6. Figure 4-8 Configure Service Callout Input Parameter


    Configure Service Callout Input Parameter

This step completes the assignment of the value returned by the XQuery expression ($body/exam:processLoanApp/loanRequest) to the inputparam variable.

Add a Service Callout Action

This section describes how you can configure the Service Callout action to send the loan application to the CreditRatingService business service, which returns the credit rating of an applicant.

  1. In the Request Actions pane of the Routing Table, click Configure Service Callout Input Parameter, then select Add an ActionArrow symbolCommunicationArrow symbolService Callout.
  2. The Service Callout action is added to the Request Action pipeline in the Routing Table.

  3. Click the Service Callout Service link. The Select Service browser window is displayed.
    1. In the Select Service window, select CreditRatingService.
    2. Click Submit.
  4. From the Operation drop-down list, select processLoanApp. The fields that allow you to configure the request and response parameters for the Service Callout are displayed:
    1. In the Service Callout Request Parameters section, set the Loan request parameter to inputparam (the message context variable you defined in the preceding section).
    2. In the Service Callout Response Parameters section, set the return parameter name to creditRating as in Figure 4-9.
    3. Figure 4-9 Configure Service Callout Action


      Configure Service Callout Action

This step completes the configuration of the Service Callout to the creditRatingService Web Service. The credit rating returned by the Web Service is assigned to the creditRating context variable.

Configure the Message Transformation

In this section, you will configure the message transformation to match the public contract (interface requirements) of the loanSaleProcessor service. You will configure the proxy service to:

Rename the Namespace
  1. Click the Service Callout icon Configure Service Callout Action, then select Add an ActionArrow symbolMessage ProcessingArrow symbolRename.
  2. The Rename action configuration fields are added to the Request Actions pane.

  3. In the Rename statement, click the <XPath> link. The XPath Expression Editor is displayed.
    1. In the XPath Expression text box, enter the following XPath expression:
    2. .//java:*

      This expression identifies every instance of a namespace with a prefix of java.

    3. Click Save to save the XPath expression and return to the Edit Stage Configuration page.
  4. In the variable text box, enter body.
  5. The body context variable contains the body of the message. You have completed creating a condition in which the XPath expression finds all the namespaces with the java prefix in the body context variable. The next step specifies the namespace with which to replace the namespaces identified by the XPath expression.

  6. Select the namespace option and enter the fully qualified namespace to be substituted in the message. The new namespace is java:large.client.
  7. Note: The namespace that you are replacing in this case is java:normal.client.

The Rename action should now appear as in Figure 4-10.

Figure 4-10 Rename Namespace

Rename Namespace

Insert a New Element in the Message
  1. Click the Rename icon Rename Namespace, then select Add an ActionArrow symbolMessage ProcessingArrow symbolInsert.
  2. The Insert action configuration fields are added to the Request Actions pane.

  3. In the Insert action, click Expression.
  4. The XQuery Expression Editor page is displayed. You will add a new namespace on this page in the subsequent steps.

  5. In the Namespace Definitions palette, locate to the User Defined Namespaces area.
  6. Figure 4-11 User Defined Namespace


    User Defined Namespace

    1. Click Add Namespace.
    2. In the Prefix field, enter lg.
    3. In the URI field, enter java:large.client
    4. Click Add.
    5. The new namespace is displayed in the User Defined Namespaces area in the Namespace Definitions palette as in Figure 4-11.

  7. In the XQuery Expression text box, enter the following expression to specify how the new element is constructed:
  8. <lg:CreditRating>{data($creditRating)}</lg:CreditRating>

    Where:

    • lg: is namespace of the element that you add to the message must be associated with the java:large.client namespace.
    • {} indicates to the XQuery engine that the content between the {} is not XML and must be interpreted.
    • At run time, the $creditRating variable is assigned a credit rating value by the credit rating service (to which we configured a Service Callout action in Add a Service Callout Action).

  9. Click Validate, then Save.
  10. Note: It is good practice is to validate the expression before you submit it.
  11. In the Insert statement, select after from the drop-down list.
  12. Click the <XPath> link. The XPath Expression Editor page is displayed.
    1. Click Variable Structures. The Variable Structures pane is displayed.
    2. In the Select Structure drop-down list in the Variables Structures pane, select body.
    3. Expand the element list and drag the Notes element and drop it into the XPath Expression text box.
    4. The following XPath expression is written to the text box

      ./exam:processLoanApp/loanRequest/java:Notes

      Note: The drag and drop functionality works only in Internet Explorer (IE) browsers. If you are using a browser other than IE, select the Notes element in the Variable Structures pane. The XPath expression is displayed in the Property Inspector palette. Place the cursor in the XPath 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 XPath Expression text box.
  13. In this statement, replace the namespace java with the namespace lg:
  14. ./exam:processLoanApp/loanRequest/lg:Notes
  15. Click Validate, then Save to return to the Edit Stage Configuration page.
  16. Enter body in the Variable text field (the last field in the expression). This is the context variable into which the new <CreditRating> element is inserted at run time.

The Insert action should now look like Figure 4-12.

Figure 4-12 Insert New Element into Message

Insert New Element into Message

This step completes the configuration of the outbound message. You added a credit rating element to the message and changed the namespace so that the message complies with the public contract (interface) of the target service.

The configuration of the outbound message should look like Figure 4-13.

Figure 4-13 Configuration of Outbound Message

Configuration of Outbound Message

Configuration of Outbound Message

Configuration of Outbound Message

The next step describes how you can configure the response actions for the LoanGateway2 proxy service.

Step 6: Configure the Routing Table Response Actions for the LoanGateway2 Proxy Service

This step describes how you can configure the response actions in the Routing Table so that the message that is returned by the proxy service to the client complies with the client's public contract (WSDL). You can configure the proxy service to:

Delete an Element
  1. Ensure that the Edit Stage Configuration page for the routing table that you created and configured in the preceding steps is open in the AquaLogic Service Bus Console.
  2. In the Routing Table Response Actions pane, select Add an ActionArrow symbolMessage ProcessingArrow symbolDelete.
  3. The Delete action configuration fields are added to the Response Actions in the Routing Table.

  4. Select the < XPath> in variable option, then click <XPath>. The XPath Expression Editor page is displayed.
    1. In the XPath Expression text box, enter the following expression:
    2. ./exam:<processLoanAppResponse>/return/lg:CreditRating 

      where <processLoanAppResponse> is the WSDL operation that was invoked with the string Response appended to it, and return is the WSDL part name.

    3. Click Validate, then Save. You are returned to the Edit Stage Configuration page.
  5. Enter body in the variable text field in the Delete action.
  6. The configuration for the Delete action is therefore:

    Delete ./exam:processLoanAppResponse/return/lg:CreditRating in variable body as in Figure 4-14.

    Figure 4-14 Delete Element


    Delete Element

You have specified that AquaLogic Service Bus removes the credit rating element from the response message as the message is processed in the response pipeline.

Add a Rename Action

This section describes how you can rename the namespace to the namespace that the client requires, that is java:normal.client.

Note: Recall that you configured the request message to the loanSaleProcessor business service to change the namespace to that required by that service. (See Rename the Namespace.
  1. Click the Delete icon Delete Element, then Add an ActionArrow symbolMessage ProcessingArrow symbolRename.
  2. The Rename action configuration fields are added to the Response Actions pane.

  3. In the Rename statement, click <XPath>. The XPath Expression Editor is displayed.
    1. In the XPath Expression text box, enter the following expression:
    2. .//lg:*

      This XPath expression finds every namespace with a prefix of lg:

    3. Click Save. The Edit Stage Configuration page is displayed.
  4. In the Rename action's variable text field enter body.
  5. Select the namespace option, and in the text field associated with the namespace, enter java:normal.client.
  6. When these steps are completed, you have specified that AquaLogic Service Bus replaces all namespaces with the prefix lg: in the response message with java:normal.client as in Figure 4-15.

    Figure 4-15 Add Rename Action


    Add Rename Action

After these steps are complete, the configuration of the response action of the proxy service appears in Figure 4-16.

Figure 4-16 Configuration of Response Actions of Proxy Service

Configuration of Response Actions of Proxy Service

The last step in the configuration of the routing table for the LoanGateway2 proxy service is to add a default routing case (an else condition) to the case expression.

Step 7: Add a Default Routing Case

This step describes how you can configure a default routing case for the routing table of the LoanGateway2 proxy service. At run time, if none of the conditions configured in the Routing Table are met, AquaLogic Service Bus routes messages according to the configuration of this default case.

  1. Click the routing table Case icon Configuration of Response Actions of Proxy Service, then select InsertArrow symbolDefault Case.
  2. The default case is added after the routing table on the Edit Stage Configuration page.

  3. Click <Service> in the default case to display the Select Services window.
    1. Select the NormalLoan business service.
    2. Click Submit.
  4. In the default case configuration operation drop-down box, select the operation processLoanApp as in Figure 4-17.
  5. Figure 4-17 Add Default Routing Case


    Add Default Routing Case

  6. Click Save to save the route node configuration and return to the Edit Message Flow page for the LoanGateway2 proxy service.
  7. Click Save on each configuration page until you return to the Summary of Proxy Services page.
  8. Click Activate, and then Submit to save the session configuration information.

You can view the map of the message flow of the proxy service in Figure 4-18.

Figure 4-18 Map of Message Flow of the LoanGateway2 Proxy Service

Map of Message Flow of the LoanGateway2 Proxy Service

Step 8: Test the Loan Application Routing Configuration

Now that you have configured AquaLogic Service Bus to work with the client and the target business services, you can test your configuration. The routing behavior of the proxy service in this scenario is based on the value of the loan amount in the loan application message. Changing the value of the loan amount changes the routing behavior.

This section describes how you can 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 also identifies the business service that processed the request.

This section includes the following test scenarios:

Test the LoanSaleProcessor 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\weblogic92\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 prompt.
  3. Change to the following directory:
  4. BEA_HOME\weblogic92\samples\servicebus\examples\src\examples\webservices\jws_basic\normal
  5. To change the routing behavior of AquaLogic Service Bus, you must edit the build.xml file run target in this directory:
    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 changes.
    5. <arg line="http://${wls.hostname}:${wls.port}/loan/gateway2 steve 555 25000001 20 5.1 notes" />

      This changes the URI of the proxy service to that of the deployed Web Service (gateway2) running in the tutorial domain, and specifies US$ 25000001 as the loan amount. For more information about the input parameters for the test, see Step 7: Test Your Loan Application Routing Configuration.

  6. If you have not already done so, deploy the business services as follows:
    1. In a command window, change to the following directory:
    2. BEA_HOME\weblogic92\samples\servicebus\examples\src\examples\webservices\jws_basic\normal 
    3. Enter ant, then press Enter.
  7. To test the build, on the command prompt, enter:
  8. ant run 

    This tests the routing logic of the proxy service. The following message from the Web Service is displayed at the command prompt:

    [java] Loan Application Response: CREDIT RATING: AA: LOAN PURCHASED BY THE <i><b>LARGE</b></i> LOANS SERVICE
         [java] Rate: 5.1
    BUILD SUCCESSFUL

The response message indicates that the Large Loan Service processed the request because the amount of the loan requested was greater than US$ 25 million.

Test the NormalLoan Business Service
  1. Follow the procedure Test the LoanSaleProcessor Business Service to edit the build.xml file in the following directory:
  2. BEA_HOME\weblogic92\samples\servicebus\examples\src\examples\webservices\jws_basic\normal

    In this case (to test the normalLoan business service), in the build.xml file, enter a value of 25000000 for the loan amount (see Step 7: Test Your Loan Application Routing Configuration), then save the changes.

  3. If you have not already done so, deploy the business services as follows:
    1. In a Command window, change to the following directory:
    2. BEA_HOME\weblogic92\samples\servicebus\examples\src\examples\webservices\jws_basic\normal 
    3. Enter ant, then press Enter.
  4. To test the routing logic of the proxy service, at the command prompt, enter:
  5. ant run

    A response message from the Web Service is displayed at the command prompt.

    [java] Loan Application Response: APPROVED BY THE <i><b>NORMAL</b></i> 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 amount of the loan requested was US$ 25 million.

 


Best Practices

In this tutorial, you configured the transformation and replaced the namespaces in the Route node. Alternatively, it is possible to configure the same logic in the request pipeline in a pipeline pair. The work you must do to accomplish the transformation and namespace replacement is the same regardless of the model that you choose.

In the case of the tutorial scenario, it is easier to add the actions to the request and response actions of the existing route node rather than create a separate pipeline pair, add a stage, and then add the transformation actions to that stage.


  Back to Top       Previous  Next