Exeption handling
eesti keeles |
SOAP fault element
If the server encounters an exception during request processing, the Creditinfo SOAP server will always return a SOAP fault element (Fault Element).
Example of a SOAP fault element:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>certificate not found</faultstring> <faultactor/> <detail> <errorcode>-10011</errorcode> <line_no>33</line_no> </detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Reporting exceptions to the user
The tag faultstring contains a user-friendly error message, while the tag detail/errorcode contains the error code.
If the SOAP fault element contains a detail/errorcode, the exception occurred in the Creditinfo server. If there is no detail/errorcode, the exception is usually unrelated to the Creditinfo server.
If SOAP fault element is sent by the Creditinfo server, the end user must always be displayed both the error code (errorcode) as well as the fault element (faultstring)!
It is recommended that the message be displayed as follows:
Creditinfo web service (<name>) request failed! [errorcode] faultstring For assistance, please contact Creditinfo: (372) 6659 600.
<name> to be replaced with the name of web service (KiDocExchange, KiReport, etc). Generally the reasons for such errors can be resolved by Creditinfo (e.g. if the user does not have the authorisation to make a certain request, etc.).