Integration Server Error Handling
The Ebase
Integration Server provides two ways in which errors within Integration
Services can be handled. These two techniques are largely alternatives and
represent different approaches to how errors are handled.
A SOAP Fault is generated when there is an error processing an Integration Service and no On Error Event is configured. The style of the SOAP Fault generated is based on the SOAP document version of the client request; this will be either a SOAP 1.1 or a SOAP 1.2 Fault - see SOAP Faults for more information. It is not currently possible to add additional information to a SOAP fault.
SOAP fault document structures, schemas etc do not need to be added to an Integration Resource.
A SOAP Fault will be returned to the client in any of the following circumstances:
The error detail will be added to the relevant fault string element of the SOAP Fault.
Example SOAP 1.1
Error
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Web
Service ping is not enabled</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Example SOAP 1.2 Error
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Receiver</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text
xml:lang="en">Web Service ping is not enabled</soap:Text>
</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>
See the Web Service Resource documentation for information on how a client might handle a SOAP Fault returned by an Integration Service.
A SOAP fault can be explicitly generated by the application by using the FPL abort script command or the API BaseForm.abort() method; the SOAP fault text is populated with the abort reason.
An on error event executes Ebase scripts when an error occur during processing of an Integration Service. One or more scripts can be configured to run if an error occurs. This acts as a failover to recover an Integration Service or set response fields when an error occurs.
An on error event can be created by selecting File -> New -> Integration -> Integration Script from the file menu. See Working with Integration Scripts for more details.
One or more Ebase scripts can be added to an on error event. On error events can be added to the Integration Service through the Integration Service Properties dialog and selecting the Events tab.
If no on error event is configured, then a standard SOAP Fault will be returned to the user when an error occurs processing, as described above.
If an on error event is specified, it receives control when an error occurs. The on error event could be used to carry out a recovery process within the integration service, or to set a value in the response document to say that an error occurred instead of using the standard SOAP Fault as described above.
Example of an on error event script:
FPL: |
API based language
(Javascript): |
//rollback the
current transaction and start a new one rollback; //set response
fields set
RESPONSE_STATUS = 'Update of customer ' + CUSTOMER_ID + ' unsuccessful'; set RESPONSE_CODE
= '101'; |
//rollback the
current transaction and start a new one system.transactionManager.rollbackAndRestartTransaction();
//set response
fields fields.RESPONSE_STATUS.value
= "Update of customer " + fields.CUSTOMER_ID.value + " unsuccessful"; fields.RESPONSE_CODE.value
= "101"; |