Databases Reference
In-Depth Information
Having selected a target endpoint, usually a business service, we can then configure
how we use that endpoint. In the case of simple location virtualization, the proxy
service and the business service endpoints are the same, and so we can just pass on
the input message directly to the business service. Later on, we will look at how to
transform data to allow virtualization of the service interface.
Selecting a service to call
We can further virtualize our endpoint by routing different requests to different
services, based upon the values of the input message. For example, we may use one
address lookup service for addresses in our own country and another service for all
other addresses. In this case, we would use the routing table option on the add action
to provide a list of possible service destinations.
The routing table enables us to have a number of different destinations, and the
message will be routed based on the value of an expression. When using a routing
table, all the services must be selected based on the same expression; the comparison
operators may vary, but the actual value being tested against will always be the
same. If this is not the case, then it may be better to use "if … then … else" routing.
The routing table may be thought of as a "switch statement", and as with all switch
statements, it is a good practice to add a default case.
In the routing table, we can create additional cases, each of which will have a test
associated with it. Note that we can also add the default case.
We need to specify the expression to be used for testing against. Clicking on the
<Expression> link takes us to the XQuery /XSLT Expression Editor . By selecting
the Variable Structures tab and selecting a new structure, we can find the input
body of the message, which lets us select the field we wish to use as the comparison
expression in our routing table.
 
Search WWH ::




Custom Search