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 | (Optional). (String). Specify the XSLT file that you want to use to transform the service error response. Use the select button to browse to and select a file. | |
ESB | (Optional). (String). (Default). 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 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 | (Optional). (String). Specify the XSLT file that you want to use to transform the service error response. Use the select button to browse to and select a file. | |
ESB | (Optional). (String). (Default). 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 has 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 or 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 are handled by the Failure Message.) |
Fault Handler Variable | Description |
$ERROR_MESSAGE | The error message produced by the exception that is causing the error. This is equivalent to the getMessage call on the Java Exception. This maps to the
faultString element for SOAP 1.1 or the
Reason element for SOAP 1.2 catch. |
$OPERATION | The operation that was invoked when this error occurred. |
$SERVICE | The service that was invoked when this error occurred. |
$TIME | The time (as determined on the Container side) at which the error occurred. |
$DATE | The date (as determined on the Container side) at which the error occurred. |
$CLIENT_IP | The IP address of the client invoking the service. This might be available for only certain invoking protocols, such as HTTP(S). |
$USER | The currently authenticated user. The user presents only if the Transport/SOAP Message have user credentials. |
$CONSUMER_APPLICATION | The currently identified consumer application (client). |
$NATIVE_STATUS_CODE | The HTTP error status code that is returned by the native service. |