Customize Error Response Assertion
The Customize Error Response assertion lets you configure the error response for a service. You can select the following responses when an error is encountered:
Customize Error Responseassertion lets you configure the error response for a service. You can select the following responses when an error is encountered:
- Template response:Lets you define your own message to be returned. This is the default.
- Drop connection:When the policy fails, simply drop the connection without providing any response.
For SOAP services, consider using the Customize SOAP Fault Response Assertion as well, as it contains SOAP-specific settings.
Using the Assertion
- Do one of the following:
- To add the assertion to the Policy Development window, see Add an Assertion.
- To change the configuration of an existing assertion, proceed to step 2 below.
- Right-clickCustomize Error Responsein the policy window and selectError Response Propertiesor double-click the assertion in the policy window. The assertion properties are displayed.
- Configure the error response:SettingDescriptionError LevelSelect the response to use for an error:
Response HTTP StatusEnter the HTTP status code to return. Alternatively, you may enter a context variable that contains the status code.Response Content-TypeEnter the valid Content-Type header to return. Alternatively, you may enter a context variable that contains the Content-Type.Extra Response HeadersOptionally specify one or more custom HTTP headers to be inserted into the custom error response (for example, to transmit application-specific metadata).Be sure you are aware of the consequences of adding headers to a message. If in doubt, please contact your system administrator.To add a header:
- Template Response:The assertion will return the response in the Response Body.
- Drop Connection:The connection is simply dropped, with no response ("stealth" mode).
To modify a header:
- Click [Add].
- Enter the Name and Value of the header. You may reference context variables in both fields.
- Click [OK]. The header is added to the list.
To remove a header:
- Select the header to modify and then click [Edit].
- Modify theNameorValueas required.
- Click [OK].
Response BodyEnter the text to be returned in the response. This text will be returned as entered; the assertion performs no validation. You may include context variables in the response body to provide additional informational information about the error. The assertion can utilize any context variable set during the execution of the policy.The Response Body does not support use of a Document Type Definition (DTD) for XML content.The Response Body can use context variables output from the encapsulated assertion.[Include the policy download URL as an HTTP header]Select this check box to indicate that the policy download URL is included as an HTTP header in the response if it is required.Clear this check box to not include the policy download URL in the HTTP header in a response.
- Select the header to remove and then click [Remove].
- Click [OK]when done.