Web service fault support in IBM Business Process Manager V8.5.5
JinShang 110000EPES Visits (10518)
Modeled faults defined in a WSDL file is the way of handling exceptions in web services at run time. The faults help user understand the problem and issue quick resolution. Before IBM Business Process Manager (BPM) V8.5.5, in order to handle the runtime exception threw out by a web service outbound (Web Service Integration), the only choice is to use "Catch All Errors" option in the "Error Intermediate Event" component. The error message cannot be recognized when developing the business process, and all of the messages are serialized to tw.system.error variable uniformly.
In version 8.5.5, IBM BPM provides a way to catch modeled faults in web service. This blog lists the detailed steps to use this feature in IBM BPM V8.5.5:
1. Define the faults in a WSDL file. The WSDL faults are modeled explicitly using the <wsdl:fault> tag inside the operation.
2. Create the “Integration Service” and then choose “Web Service Integration” to create the outbound integration. Launch WSDL Discovery to parse the WSDL fault definitions, and store the fault information using the extended internal model – TWWS
3. Launch the Generate Types operation to generate a set of Business Objects (these BOs will be used later as error types in Error Events) for the WSDL faults.
4. Choose the corresponding operation to register the WSDL faults for the selected operation.
5. Drag one “Error Intermediate Event” to the WSI component. In the Implementation tab, specify the error intermediate event with declared error type by choosing “Catch Specific Errors”.
6. Catch specific WSDL fault from the popup view (a list of known WSDL faults) by clicking the right button of “Error code”. Select one pre-defined local variable from the pop-up view to map the runtime fault data by clicking the right button of “Error mapping”.
7. Define the specific fault handler. This demonstration uses a server snippet to print the fault message.
8. After all the design time effort is complete, invoke the WSI to request one external web service provider. The following soap message will be returned by the web service provider.
9. Once the fault response is received by WSI, fault handling functionality will be triggered to deserialize the soap fault content into one corresponding TWObject instance. The corresponding “Error Intermediate Event” flow will be invoked for fault handling. In this sample, the fault message is displayed iin the browser.