Traditional error handling example
- Last Updated: January 16, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
The code in the following example:
- Uses the ABL
VALID-HANDLEfunction to determine if a givenERRORcondition (ERROR-STATUS:ERROR = TRUE) is caused by a SOAP fault by testing the validity of the handle returned by theERROR-STATUS:ERROR-OBJECT-DETAILattribute - Assigns a handle variable (
hSoapFault) to any valid SOAP-fault object returned by theERROR-STATUS:ERROR-OBJECT-DETAILattribute for code readabilityNote: You can also use theERROR-STATUS:ERROR-OBJECT-DETAILhandle attribute directly to work with the SOAP-fault object. - Examines the values of SOAP fault elements, as required, using appropriate attributes
(
SOAP-FAULT-CODE) on the SOAP-fault object handle - Uses the ABL
VALID-HANDLEfunction to determine if this SOAP fault has SOAP fault detail by testing the validity of the handle returned byhSoapFault:SOAP-FAULT-DETAIL - Assigns a handle variable (
hSoapFaultDetail) to the SOAP fault-detail object returned by thehSoapFault:SOAP-FAULT-DETAILattribute for code readabilityNote: You can also use theERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-DETAILhandle attribute directly to work with the SOAP fault-detail object. - Returns the root node of the underlying SOAP fault
<detail>element by using thehSoapFaultDetail:GET-NODE()method to assign the root node to the x-noderef object referenced by the handle variablehxnoderef - Can now use the methods and attributes of the x-noderef object handle
(
hxnoderef) and additional handle variables to walk the XML DOM subtree referenced byhxnoderefto examine the content of the SOAP fault<detail>element as specified by the WSDL for the Web service
|