Question & Answer
Question
REST API Auto Generated Error Handler Over
Answer
On Demand Consulting
Author: Marilza Maia
IBM Integration Bus (IIB) V10
REST API Auto Generated Error Handler Overview
IIB V10 provides a wizard to create a REST API message flow and Error Handling subflows. This article provides an overview of how to auto-generate exception handling for an IIB REST API service. There are three links in the Error Handling list of the REST API Description:
Author: Marilza Maia
IBM Integration Bus (IIB) V10
REST API Auto Generated Error Handler Overview
IIB V10 provides a wizard to create a REST API message flow and Error Handling subflows. This article provides an overview of how to auto-generate exception handling for an IIB REST API service. There are three links in the Error Handling list of the REST API Description:
- Implement the Catch handler
- Implement the Failure handler
- Implement the Timeout handler
Click on one or more of the links highlighted in the figure below and the exception handling subflow(s) templates are automatically created.

In this example all three links were selected therefore the following three subflows were automatically generated.
- EmployeeService_RESTInput CatchHandler.subflow
- EmployeeService_RESTInput FailureHandler.subflow
- EmployeeService_RESTInput TimeoutHandler.subflow
You can select the exception handler you want to implement. You don't necessarily need to implement all three of them. Select the ones that fit your application requirements.
The subflow templates are listed in the subflow section of the Application as shown below.

Assuming that the REST API message flow has already been created the auto-generated subflows are automatically wired to the appropriated terminals in the HTTP Input Node of the EmployeeService_REST message flow. The HTTP terminals are:

The IIB REST API wizard automatically wires the exception handler subflows that you selected to implement to the HTTP Input node. See the message flow in the figure shown below and notice that the terminals are wired to the subflows;
- the Failure terminal is wired to EmployeeService_RESTInput FailureHandler.subflow
- the Catch terminal is wired to EmployeeService_RESTInput CatchHandler.subflow
- the HTTP timeout terminal is wired to EmployeeService_RESTInputTimeoutHandler.subflow

The REST API wizard does all the work except that the subflows are templates and therefore they're empty. You must add the exception handling solution in each subflow. In the example below a trace note was added but any other exception handling solution can be implemented in the subflow. For instance a Java Compute node or a Compute node can be configured/coded to evaluate the type of exception in the Exception List and take the appropriated action. An exception message can also be written to a queue using an MQOutput node or any other exception handling solution can be implemented based on the requirements of your application design.

You can find more information on IIB REST API exception handling at https://www.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/bi12028_.htm?view=embed
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSQTW3","label":"IBM On Demand Consulting for Hybrid Cloud"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"","label":""}}]
Was this topic helpful?
Document Information
Modified date:
05 March 2019
UID
ibm10771809