Configure the LoanGateway1 Proxy Service
Oracle 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.
Configure the Routing Behavior of the Message Flow
1. In the Oracle Service Bus 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. In the Actions column associated with the LoanGateway1 proxy service, click
the Edit Message Flow icon
4. Click LoanGateway1, and select Add Route from the menu options.
5. Click RouteNode1 and select Edit Route from the menu options.
6. Click the Add an Action link, and select Communication > Routing
Table.
The Edit Stage Configuration page changes to display routing table
configuration page, as shown in the following figure.
7. In the Routing table, click <Expression>. The XQuery Expression Editor is
displayed.
8. In the left pane, click Variable Structures.
9. The Variable Structures pane is displayed. Select body from the Select
Structure list.
A structural representation of the body element is displayed in the Variable
Structures pane.
10. Click + to expand $body - processLoanApp (request) > processLoanApp >
loanRequest.
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.
11. Click the Rate element. The property appears below the XQuery editor in the
Property Inspector field. Click in the XQuery text box and click Copy
Property in the lower right of the XQuery Expression text box.
12. 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.
13. 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.
14. In the Operator list, select <. In the associated text field enter the number 5.
15. 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.
a. Select the ManagerLoanReview business service.
b. Click Submit.
16. In the Routing Table Operation 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.
Add a Default (Else) Condition to the Routing Table
1.
Click the Case icon (below the Routing Table label), then select Insert
Default Case. The else condition (default case) is added to the routing
table.
2. In the Default (else) condition, click the Service link. The Select Service page
is displayed.
a. Select the NormalLoan business service.
b. Click Submit.
3. In the Operation list, select the processLoanApp operation for the service.
This step completes the configuration of the message flow in the route node:
RouteNode1.
4. Click Validate to validate the RouteNode1 routing configuration.
5. Click Save on the Edit Stage Configuration page to save the configuration
and return to the Edit Message Flow page.
6. Click Save on the Edit Message Flow page and return to the
MortgageBroker/ProxyServices page.
7. In the Change Center, Activate the session.
Test Your Loan Application Routing Configuration Using the Test Console
1. In Oracle Service Bus Console, make sure the current session is activated.
2. Select Resource Browser > Proxy Services in the left panel.
3. Click on Launch Test Console icon in Actions column for LoanGateway1
4. Replace the default payload in loanRequest field with the following code:
<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>
5. Accept other default settings and click Execute.
|
0 comments:
Post a Comment