SOAP faults with structured error handling
- Last Updated: March 19, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
You can also trap the error using a CATCH block, which is the error handler for the ABL structured error
handling model. In this scenario, the AVM generates an error object based on the
built-in Progress.Lang.SoapFaultError class. The
SoapFault property of the class contains a
handle to the built-in SOAP-fault object. Recall that the SOAP-fault object is the
ABL representation of a SOAP fault. Thus, SoapFaultError error object is a wrapper for the same SOAP-fault
object you could also have accessed using the NO-ERROR option and the ERROR-OBJECT-DETAIL attribute of the ERROR-STATUS system handle.
This is the basic structure of a block with a CATCH block:
|
Examples of ABL accessing a SOAP fault provides more detailed information.
Structured error handling represents errors as objects. ABL includes a hierarchy of classes that allow all error types to be represented as objects. The following table summarizes the class representing all system errors and its subclass that represents SOAP errors.
| Class | Members | Description |
|---|---|---|
Progress.Lang.SysError
|
Inherits the Progress.Lang.ProError members:
|
A subclass of Progress.Lang.ProError that represents (with its
subclasses) all ABL system errors |
Progress.Lang.SoapFaultError
|
Inherits the Progress.Lang.ProError members and adds:
|
A subclass of Progress.Lang.SysError that contains a reference to a
Web service SoapFault
object |
The following table describes the properties and methods of the Progress.Lang.SoapFaultError class.
| Member | Description |
|---|---|
CallStack property |
Returns the contents of the call
stack at the time the error object was thrown as a string. If the
ERROR-STACK-TRACE attribute of
the SESSION handle is false, then
this property returns the Unknown value
(?). To enable the call stack, set SESSION:ERROR-STACK-TRACE property to
TRUE directly, or use the
-errorstack session startup
parameter. |
NumMessages property |
In ABL, an error is represented as a pair of values. The message number is a unique number identifying the particular error. The error message is a string which describes the error. This property indicates how many error number and error message the error object contains. |
Severity property |
The Severity property is not used by ABL system errors. It
is provided as a mechanism for you to use to assign severity
rankings to your various application errors (Progress.Lang.AppError). |
GetMessage(
MessageIndex
) method |
Returns the error message for the indexed error in the error object, beginning with one (1). If there is no error message at the indicated index, the method returns the empty string. |
GetMessageNum(
MessageIndex
) method |
Returns the error message number
associated with the indexed error in the error object. For Progress.Lang.SysError objects and
subclasses, the method returns the Progress message number for the
system generated error. If there is no error message at the index,
the method returns the empty string. |
SoapFault
|
Identifies the SOAP-FAULT object handle that contains
a SOAP fault message detail.If the ABL
application invokes a Web service operation that returns a SOAP
fault message, the AVM creates a see Managing a SOAP fault for more information about the
|