Managing exceptions

The exceptions of the web service method are returned to the merchant website as an XML Fault element.

E.g., an exception is returned when the format of the object attributes required for the execution of operations is incorrect.

Example:

Incorrect format of the e-mail address (@ missing) upon token creation.

The <soap:Fault> exception will contain the exception chain and its source.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">   
<env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope"/>   
<soap:Body>     
<soap:Fault>
	<soap:Code>
	<soap:Value xmlns:ns1="http://www.w3.org/2003/05/soap-envelope">ns1:Sender</soap:Value>
	</soap:Code>
	<soap:Reason>
	<soap:Text xml:lang="en">CreateRequest.customerRequest.billingDetails.email: Incorrect format of the email address</soap:Text>
	</soap:Reason>
	<soap:Detail>
	<requestId>43a61cf4-e467-490e-871e-d61604577cb0</requestId>
	</soap:Detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>

This mechanism of exception management allows to identify and correct the data with incorrect format prior to executing an operation.