Web service faults

Faults are a way of handling exceptions in web services at run time. A fault that helps a user understand a problem and what he can do about it leads to a quick resolution of the problem. If you use a Web Service Integration step from the integration service palette to call an outbound web service, your step can catch and handle faults.

To catch and handle faults, attach an error intermediate event to the web service integration. By default, configure the error intermediate event with the Catch All Errors option to catch faults which are modeled in WSDL, as well as other faults such as system or connectivity exceptions. For more information on handling faults, see Handling errors in services.

Figure 1. An outbound web service integration with attached error intermediate eventThis graphic shows a web service integration service with an error intermediate event.

If you want to catch specific WSDL faults (those that match a particular fault name or fault type), use the Catch Specific Errors option in the error intermediate event.

Use the following requirements when you define the WSDL fault:
  • Specify a value for the name that begins with either an alphabetical character or the underscore (_) character. Valid values can include alphabetical characters, numbers, and the underscore. Names cannot contain words that are used within IBM Business Process Manager (for example, arrayOf or listOf).
  • When defining wsdl:part entries for the fault, use the element attribute in order to comply with the WS-I Basic Profile specification.
The following example shows a web service that contains an error intermediate event that is set to catch specific WSDL errors, such as multiCFaultFault1. You can see the settings in the Error Properties section of Process Designer, as well as an excerpt of the related WSDL file.
This graphic shows the Error Properties section of Process Designer; the Catch Specific Errors option is checked.
<wsdl:operation name="multiCFault">
	    <wsdl:input message="tns:multiCFaultRequestMsg" name="multiCFaultRequest"/>
    <wsdl:output message="tns:multiCFaultResponseMsg" name="multiCFaultResponse"/>
    <wsdl:fault message="tns:multiCFault_multiCFaultFault1Msg" name="multiCFaultFault1"/>
    <wsdl:fault message="tns:multiCFault_multiCFaultFault2Msg" name="multiCFaultFault2"/>
</wsdl:operation>

After the web service integration discovers the WSDL file and generates the types (the input and output variables needed for the service), the specified faults can be caught when the web service runs.