Try OpenEdge Now
skip to main content
Managed Adapters Guide
Web Service Managed Adapter : Fault handling : Describing a fault
 

Describing a fault

Each operation in WSDL can have one (or more) declared faults. As in Java, you can declare the exceptions that are thrown, using the "throws" keyword.
Example, public Product getProduct() throws ProductNotFoundException;
An example of a method with fault handling is provided in WSDL as shown below.
<wsdl:operation name="getProduct" parameterOrder="in0">
<wsdl:input message="impl:getProductRequest"
    name="getProductRequest"></wsdl:input>
<wsdl:output message="impl:getProductResponse"
    name="getProductResponse"></wsdl:output>
<wsdl:fault message="impl:ProductNotFoundException"
    name="ProductNotFoundException"></wsdl:fault>
</wsdl:operation>
In this example, the method converts the "ProductNotFoundException" to a fault in the SOAP operation.
The following sections describe the implementation of the SOAP fault handling in the Web Service managed adapter configurator.