Wrapping exceptions into faults

This recipe explains the definition of faults in web services. Faults are one of the fundamental concepts of handling errors in web services. Usually, web services throw an exception as a result of an unsuccessful operation. This recipe will explain how to define faults for an operation in case of a date format mismatch.

Getting ready

In this recipe, we will amend the implementation of our web service example from the Annotating the service endpoint interface with @SOAPBinding recipe.

How to do it…

We will change the source code of our example so that it will throw an exception in case there is a problem with processing a credit card operation. Now, if we run the example, even if the authorization fails, the processing ...

Get BPEL and Java Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.