How to set a default response when a service cannot be found
search cancel

How to set a default response when a service cannot be found


Article ID: 9737


Updated On:


STARTER PACK-7 CA Rapid App Security CA API Gateway


When attempting to reach a gateway service that either does not exist or is otherwise unable to be resolved the below error is returned by default.


<l7:policyResult xmlns:l7="" status="Service Not Found. The request may have been sent to an invalid URL, or intended for an unsupported operation."/>


Release: API Gateway 10.x and 11.x And before.


To customize the message returned to end users a catch all policy can be configured

1. Launch policy manager

2. Publish a Web API

    [9.1] Tasks Menu -> Service and APIs -> Publish Web API

    [9.0 and under] Tasks -> Publish Web API

3. Enter the resolution path as an asterisk (*). This will catch all calls at the root of the Gateway.

4. Click finish

5. You can now write a policy to suite your needs. Common uses are using a 'Return Template Response' assertion with any message you desire such as:

You can also use a customize error response and cause a fault to return a custom gateway error instead of a template response.



1558693566745000009737_sktwi1f5rjvs16he5.png get_app