Error Handling

If a message is valid against the formal rules of the validator, it is transformed to a SOAP request and sent to Microsoft Dynamics CRM. MS CRM verifies the request against business rules and may produce an error message. iWay Application Adapter for Microsoft Dynamics CRM 2011 On-Premises handles such messages and produces XML documents according to XML schemas with error messages. Each response has the following two elements:

<xs:element name="Error" type="xs:string" minOccurs="0" />
<xs:element name="Status" minOccurs="1" maxOccurs="1">
    <xs:simpleType>
        <xs:restriction base="xs:string">
            <xs:enumeration value="Fail" />
            <xs:enumeration value="Success" />
        </xs:restriction>
    </xs:simpleType>
</xs:element>

Element Status indicates whether the result of the execution was a success or failure. Since this element is mandatory, it is present in each response produced by iWay Application Adapter for Microsoft Dynamics CRM 2011 On-Premises.

Element Error is present only when the request execution failed. This element contains error messages as it is returned by MS CRM.

An error may occur before the message is processed in MS CRM. For example, you can receive an error if the network is unreachable or if the authentication has failed. In this case, the infrastructure of the adapter is responsible for the error message. Each adapter has additional parameters in runtime which regulates how to process any non-business errors.

If the Create Error Document checkbox is selected (set to On), then the following XML document is received, which contains an error description:

<AdapterException AdapterClass="com.ibi.mscrm2011.adapter.CRMAdapter">
  Error occurred during processing input CRM message: The target server failed to respond
</AdapterException> 

If the Create Error Document checkbox is not selected, then the following low-level error message is received:

<eda>
    <error timestamp="2012-08-16T16:00:51Z" code="6" stage="AGENT" source="com.ibi.agents.XDAdapterAgent">
Problem processing agent request, type FAIL, source AGENT: getMessage(): Error occurred during processing input CRM message int getError(): Client getAdapterCode(): 
null getVendorThrowable(): com.ibi.mscrm2011.adapter.XmlException: Parse failure: org.xml.sax.SAXParseException: Premature end of file. 
<data type="xml">
<?xml version="1.0" encoding="UTF-8"?> <account.Assign xmlns="urn:iwaysoftware:adapter:MSCRM2011:account:Assign" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iwaysoftware:adapter:MSCRM2011:account:Assign file:/D:/iway/project/CRM2011NativeMode/Adapter/src/main/resources/NewXMLSchema.xsd" schemaVersion="1.0">
<EntityList> 
    <Entity>
        <Params>
            <Target> <Id>0B096E25-07D7-E111-BC89-0050568845D9</Id>
                <LogicalName>account</LogicalName>
                <Name>www</Name>
            </Target> 
            <Assignee>
                <Id>EFBDF25E-3D8D-E111-A4C8-0050568845D9</Id>
                <LogicalName>systemuser1</LogicalName>
                <Name>Name1</Name>
            </Assignee> 
        </Params>
    </Entity>
</EntityList> 
</account.Assign> 
</data>
</error>
</eda>

iWay Software