Release 10.1A: OpenEdge Development:
Web Services

> ## Client programming for SOAP faults

> Client interfaces typically convert SOAP faults to client exceptions. Client code should handle SOAP faults and alert the user. Client languages catch errors in different ways. One of the more common techniques is to use `try...catch` blocks such as those used in Java and VB.NET.

> Note: For the Progress 4GL, OpenEdge translates SOAP faults into Progress 4GL errors and provides access to the SOAP fault information. For more information, see Chapter 12, " Handling Errors in Progress 4GL Requests to Web Services."

> Caution: In any `catch` block or other error routine where you exit the program, you must release all Web service objects that you have created in the program.

> This is the general format for a SOAP fault, with content indicated by the XML comments:

> SOAP faults—general format
>     <?xml version="1.0" encoding="UTF-8" ?>
>     <soap:Envelope namespaces defined here…>
>        <soap:Body>
>           <soap:Fault>
>              <faultcode> <!-- Client or Server Environment --> </faultcode>
>              <faultstring> <!-- Basic Error Message (12345) -->
>              </faultstring>
>              <detail>
>                 <ns1:FaultDetail
>                    soap:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/
>                       xmlns:ns1="http://... WSA root URL ...">
>                   <errorMessage xsi:type="xsd:string"><!-- Initial error
>                       message (99999) --></errorMessage>
>                   <requestID xsi:type="xsd:string"> <!-- Unique request ID -->
>                   </requestID>
>                 </ns1:FaultDetail>
>              </detail>
>           </soap:Fault>
>        </soap:Body>
>     </soap:Envelope>

> For more information on catching and viewing SOAP faults and working with log files to debug 4GL Web services, see Chapter 7, " Testing and Debugging Progress 4GL Web Services."

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095