Try OpenEdge Now
skip to main content
Web Services
Creating OpenEdge SOAP Web Services : Building Clients for OpenEdge SOAP Web services : Handling Web service errors and SOAP faults : Client programming for SOAP faults
 
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 C#.
Note: For ABL, OpenEdge translates SOAP faults into ABL errors and provides access to the SOAP fault information. For more information, see Handling Errors in ABL Requests to OpenEdge SOAP 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>
        <FaultDetail xmlns="http://... WSA root URL ...">
          <errorMessage xsi:type="xsd:string">
            <!-- Initial error message (99999) --></errorMessage>
          <requestID> <!-- Unique request ID --> </requestID>
        </FaultDetail>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>
For more information on catching and viewing SOAP faults and working with log files to debug OpenEdge Web services, see Working with SOAP faults.