CentraSite Documentation : Runtime Governance with CentraSite : Run-Time Governance Reference : Built-In Run-Time Actions Reference for APIs : Run-Time Actions Reference : Conditional Error Processing
Conditional Error Processing
 
Failure Messages
This action returns a custom error response (and/or the native provider’s service fault content) to the client when the native provider returns a service fault. You can configure conditional error processing and use variables to create custom error messages. This action also allows you to define error messages based on content types: text, XML, and JSON.
Alternatively, you can configure global error responses for all APIs, using Mediator's Service Fault Configuration page (see Administering webMethods Mediator).
Note:  
To enable support for conditional error processing in CentraSite, you must add an entry in the custom\conf\centrasite.xml file as follows: <Action name="ConditionalErrorProcessing" id="uddi:61849291-3bad-4612-819b-5fe5a6b4e958" occurrence="*"></Action>. For details on configuring the centrasite.xml file, see CentraSite documentation.
Input Parameters
Error Conditions
Specifies the error conditions and how each of these error conditions are to be processed. You can define a maximum of three conditions. You can configure only one error condition per type. For example, you cannot define two status code conditions. To specify multiple conditions, use the plus button to add rows.
Type
Value
Description
Status Code
Default Specify the error status code. For example: 400, 500.
HTTP Header
Specify the details of the custom HTTP header(s) included in the client requests. The parameters are:
*HTTP Name String. Specifies the name of the HTTP header.
*HTTP Value String. Specifies the value of the HTTP header.
XPath Expression
Specifies the details of the XPath expression in the API request. The parameters are:
*XPath Expression
*Namespaces: Specifies the namespace of the XPath expression. To specify multiple XPath expressions, use the plus button to add rows.
*Prefix: The prefix for the namespace. For example,soapenv or axis
*URI: The namespace URI - For example, http://schemas.xmlsoap.org/soap/envelope/ or http://ws.apache.org/axis
*Value: Specifies the value of the XPath expression.
Pre-Processing
Specifies how the native service error response is to be processed before sending the same to Mediator. You can configure multiple ESB and XSLT processing steps. You can either log the error message sent by the native service without any changes or you can remove any critical information that you do not want Mediator to log or send to the client. The processing of these steps is taken up in the order in which they are configured.
Value
Description
XSLT
String. Optional. Specify the XSLT file that you want to use to transform the service error response. Use the Choose button to browse to and select a file.
ESB
Default. String. Optional.
Specify the webMethods IS Service.
Invokes one or more webMethods IS services to manipulate the response message from the native API before it is returned to the consuming application. The IS service will have access to the response message context (the axis2 MessageContext instance) before it is updated with the custom error message. For example, you might want to send emails or perform custom alerts based on the response payload.
Failure Message
String. Specify the custom failure message that Mediator should send to the client. You can configure an error template each for the content types: Text, XML, and JSON. For addition details, see the fault handler variables listed in the table below. For example, $CONSUMER_APPLICATION $OPERATION :$ERROR_MESSAGE.
Value
Description
Content-Type
Specifies the content type for which the failure message is defined. You can select the following content types:
*text
*xml
*json
Note:  
You can define only one error template per content type.
Error Template
Specifies the content of the error template to use. You can use predefined fault handler variables to create the error template. A list of the predefined variables is available in the table below.
Use as Default
Specifies the error template to use as the default.
Custom Error Variables
Specify the error variables to be used in the custom error message. To specify multiple error variables, use the plus button to add rows.
Payload Type
Select the payload type.
Value
Description
Request
Selects the request payload type.
Response
Selects the response payload type.
Name
Specifies the name of the payload.
XPath Expression
Specifies the details of the XPath expression in the API request.
Namespaces
Specifies the namespace of the XPath expression. To specify multiple namespaces , use the plus button to add rows.
Prefix
The prefix for the namespace.
URI
The namespace URI.
Post-Processing
You can configure multiple ESB and XSLT processing steps. You can either log the error message sent by the native service without any changes or you can remove any critical information that you do not want Mediator to log or send to the client. The processing of these steps is taken up in the order in which they are configured.
Value
Description
XSLT
String. Optional. Specify the XSLT file that you want to use to transform the service error response. Use the Choose button to browse to and select a file.
ESB
Default. String. Optional.
Specify the webMethods IS Service.
Invokes one or more webMethods IS services to manipulate the API fault after the Conditional Error Processing action is invoked. The IS service will have access to the entire API fault and the Conditional Error Processing message. You can make further changes to the fault message structure, if needed.
Send Native Provider Fault Message
When the parameter is enabled, Mediator sends the native SOAP / REST failure message to the client. When you enable this parameter, the Failure Message is ignored when a fault is returned by the native API provider. (Faults returned by internal Mediator exceptions will still be handled by the Failure Message.)
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback