Throwing the faults from BPEL

In this recipe, we will identify the ways of how to throw the faults from BPEL. For this recipe, we will adapt the BPEL process from the previous recipe.

How to do it…

In the previous recipe, we saw that the web service performed the check against the dates. However, we would like to change the BPEL process so that some basic checking on the dates is performed in the BPEL process. We will check if the from and to dates are the same. If they are the same, we will throw the fault.

  1. We start by defining the new schema element for the fault.
    <element name = "faultResponse">
      <complexType>
        <sequence>
          <element name = "msg" type = "string"/>
        </sequence>
      </complexType>
    </element>
  2. We also define the new message in WSDL that will ...

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.