WSDL faults

In the previous sections, we discussed different types of faults that can be generated. They can be explicitly generated by the BPEL developer or implicitly generated by the BPEL runtime. Also, we mentioned that there can be faults generated due to faults in external web service invocations. And in Chapter 5, Interaction Patterns in BPEL, we discussed the synchronous and asynchronous web service invocations. Both of these can generate faults in the BPEL process. But WSDL faults are a special scenario that occurs only due to synchronous web service invocations.

These faults become a special scenario, as the WSDL specification itself defines a WSDL fault for a synchronous web service invocation. So the BPEL runtime implicitly signals faults if it receives something like an incoming fault message rather than defining a <throw> activity explicitly to monitor such incoming fault messages and signals.

WSDL fault specification

As we mentioned in the WSDL faults section, WSDL faults can be defined in the WSDL itself. So the BPEL process developer does not need to define a schema for the fault on his own, as there is already an existing schema for the fault in the WSDL representation of the web service. Even if the BPEL process is designed to throw faults to its clients who initiate the request to the BPEL process, the BPEL developer needs to define such WSDL faults in the WSDL representation for the BPEL process.

Let's remember the WSDL representation of a synchronous web service invocation without the fault. It is only represented in a two-way operation with an input (request) and an output (response). The message attribute refers to the schema of the request and response message. Consider the following code snippet:

<portType name="Warehousing_porttype">
  <operation name="warehousingOperation">
    <input message="tns:inputMessage"/>
    <output message="tns:responseMessage"/>
  </operation>
</portType>

Once we add the WSDL fault, it looks like this:

<portType name="Warehousing_porttype">
  <operation name="warehousingOperation">
    <input message="tns:inputMessage"/>
    <output message="tns:responseMessage"/>
    <fault message="tns:faultMessage" />
  </operation>
</portType>

A WSDL message of the fault message is defined by tns:faultMessage and it can be referred to an XML schema as follows:

<message name="faultMessage">
  <part name="fault" element="tnst:faultMessageType"/>
</message>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset