Asynchronous call error handling example
- Last Updated: September 15, 2022
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
As mentioned in "Results handling" topic in the OpenEdge Development:
Web Services, Version 12.2 guide, class-based error objects returned from an
asynchronous call are handled slightly differently:
- Note that, in contrast to comment 2 in the Traditional error handling example, the code retrieves the error object from
the
ERROR-OBJECTattribute of the asynchronous call handle (hRequest). - The
ERROR-OBJECTattribute returns a reference to an object that implements theProgress.Lang.Errorinterface. To access information beyond the attributes inherited fromProgress.Lang.Error, the object referenced bymyerris cast to the more specific type of object returned,Progress.Lang.SoapFaultError. - Checks the
numMessagesproperty ofsoaperr(part ofProgress.Lang.Error's implementation) and displays messages as necessary. - Uses the ABL
VALID-HANDLEfunction to determine theSoapFaultproperty ofsoaperrpoints to a valid Soap-Fault object handle. If so, the information in the handle's attributes is displayed. - Uses the ABL
VALID-HANDLEfunction again to determine if the SOAP fault has SOAP fault detail by testing the validity of the handle returned byhSoapFault:SOAP-FAULT-DETAIL. If so, it assigns a reference to the handle to the variableSOAPFaultDetail.
Sample asychronous error procedure
|