Exeption handling: Difference between revisions

From services.krediidiinfo.ee
Jump to navigation Jump to search
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 Krediidiinfo SOAP server will always return a SOAP fault element ([http://www.w3schools.com/soap/soap_fault.asp|SOAP Fault Element]).
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 Krediidiinfo server. If there is no ''detail/errorcode'', the exception is usually unrelated to the Krediidiinfo server.   
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 Krediidiinfo server, the end user must always be displayed both the error code (''errorcode'') as well as the fault element (''faultstring'')!
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>
Krediidiinfo AS web service (<name>) request failed!
Creditinfo web service (<name>) request failed!
[errorcode] faultstring  
[errorcode] faultstring  
For assistance, please contact Krediidiinfo: (372) 6659 600.
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 Krediidiinfo (e.g. if the user does not have the authorisation to make a certain request, etc.).
<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

Flag of Estonia.svg 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.).