Exeption handling: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
= SOAP fault element= | = SOAP fault element= | ||
If the server encounters an exception during request processing, the | If the server encounters an exception during request processing, the Creditinfo SOAP server will always return a SOAP fault element ([http://www.w3schools.com/soap/soap_fault.asp|SOAP Fault Element]). | ||
Line 29: | Line 29: | ||
The tag ''faultstring'' contains a user-friendly error message, while the tag ''detail/errorcode'' contains the error code. | 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 | 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 | 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: | It is recommended that the message be displayed as follows: | ||
<pre> | <pre> | ||
Creditinfo web service (<name>) request failed! | |||
[errorcode] faultstring | [errorcode] faultstring | ||
For assistance, please contact | For assistance, please contact Creditinfo: (372) 6659 600. | ||
</pre> | </pre> | ||
<name> to be replaced with the name of web service (KiDocExchange, KiReport, etc). Generally the reasons for such errors can be resolved by | <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.). |
Latest revision as of 14:11, 6 December 2016
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.).