CentraSite Documentation : Runtime Governance with CentraSite : Important Considerations when Configuring REST or XML Virtual Services : Handling Virtual REST APIs with Multiple Resources : Scenario B : Content-Based Routing Action
Content-Based Routing Action
Given the Content-Based Routing action, specify a custom routing rule. Perform the following steps:
1. In CentraSite Business UI, display the details page for the native REST API. If you need procedures for this step, see Working with REST-based APIs in CentraSite.
2. In the action bar for the API, click Virtualize.
3. In the Virtualize <API_Name> (Step 1 of 3) wizard, select the virtual alias and it’s endpoint for reconfiguration.
4. Click Next.
5. In the Virtualize <API_Name> (Step 2 of 3) wizard, locate the “Content-Based” routing action in the Message Flow section.
6. Mouse hover the action name, and click the Configure icon to the right of the name. This opens the Content-Based Routing dialog box.
7. In the Default Route to endpoint field, modify the existing endpoint. Append the resource path tokenizer ${sys:resource_path} with the base URL in the format <base-url>/${sys:resource_path}.
Thus, for our sample endpoint:
http://www.phonestore.com/api/phones
The modified endpoint should be:
http://www.phonestore.com/api/${sys:resource_path}
8. Click the Add Routing Rule button. In the Routing Rule dialog box, complete the following fields:
a. In the XPath Expression field, specify an XPath expression unique to the resource.
b. Add a namespace value in the Prefix and URI fields.
c. In the Route To field, specify the native API endpoint.
In our sample,
http://www.phonestore.com/api/phones
d. Click OK to save the new routing rule.
9. Click OK and save the modified API.
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback