Thursday, August 28, 2014

Examining the raw data under different fault scenarios using WCF

1.       Data is requested using an ID, and is returned normally
The request:
POST http://q2testint.develop.fcbt/AbolWebService/AbolWebService.svc HTTP/1.1
Content-Type: text/xml; charset=utf-8
VsDebuggerCausalityData: uIDPo2WwjVIEzYdEjqxDRlVRhCsAAAAAHt+W9uGBGkKFG5Y+JmYo4B63eSt8WWVMmwycwaurSYAACQAA
SOAPAction: "http://tempuri.org/IAbolWebService/GetDocumentListByAssociationFacilityControlNumbers"
Host: q2testint.develop.fcbt
Content-Length: 376
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
                <s:Body>
                                <GetDocumentListByAssociationFacilityControlNumbers xmlns="http://tempuri.org/">
                                                <associationId>DATZS08</associationId>
                                                <facilityControlNumbers>00001251</facilityControlNumbers>
                                </GetDocumentListByAssociationFacilityControlNumbers>
                </s:Body>
</s:Envelope>
A soap envelope with the request data is POSTed by the client

The response when records were returned
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
                <s:Body>
                                <GetDocumentListByAssociationFacilityControlNumbersResponse xmlns="http://tempuri.org/">
                                                <GetDocumentListByAssociationFacilityControlNumbersResult xmlns:a="http://schemas.datacontract.org/2004/07/Applications.Abol" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                                                                <a:Document>
                                                                                <a:DocumentFormat>pdf</a:DocumentFormat>
                                                                                <a:DocumentName>Statement - Period 05/01/2013 - 05/31/2013</a:DocumentName>
                                                                                <a:DocumentType>Statement</a:DocumentType>
                                                                                <a:DocumentUrl>http://portal- /DocIdRedir.aspx?ID=6K3XF6XK5YEP-1-6094</a:DocumentUrl>
                                                                                <a:FacilityControlNumber>00001251</a:FacilityControlNumber>
                                                                                <a:PreparedDate>2013-05-31T05:00:00Z</a:PreparedDate>
                                                                                <a:Year>2013</a:Year>
                                                                </a:Document>
                                                </GetDocumentListByAssociationFacilityControlNumbersResult>
                                </GetDocumentListByAssociationFacilityControlNumbersResponse>
                </s:Body>
</s:Envelope>
Server returns a soap envelope that contains a result element inside the response element.

The response when no records were found
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
                <s:Body>
                                <GetDocumentListByAssociationFacilityControlNumbersResponse xmlns="http://tempuri.org/">
                                                <GetDocumentListByAssociationFacilityControlNumbersResult xmlns:a="http://schemas.datacontract.org/2004/07/Applications.Abol" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
                                </GetDocumentListByAssociationFacilityControlNumbersResponse>
                </s:Body>
</s:Envelope>
A soap envelope returns a response element that contains an empty result element.



The response when a system exception occurred:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <s:Fault>
      <faultcode>s:Client</faultcode>
      <faultstring xml:lang="en-US">The creator of this fault did not specify a Reason.</faultstring>
      <detail>
        <CustomException xmlns="http://schemas.datacontract.org/2004/07/Services.CommonType" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
          <DetailExceptionMessage>Config setting missing in AbolWebService&#xD;
A request has been made to connect to XRM org for association ID:DATZS08. This failed, because the web.config file on the AbolWebService does not contain an appsetting called XRM_DATZS08. This appsetting contains the URL to the respective association's XRM org.&#xD;
</DetailExceptionMessage>
          <ExceptionMessage>A request has been made to connect to XRM org for association ID:DATZS08. This failed, because the web.config file on the AbolWebService does not contain an appsetting called XRM_DATZS08. This appsetting contains the URL to the respective association's XRM org.</ExceptionMessage>
          <InnerException/>
          <StackTrace/>
          <Title>Config setting missing in AbolWebService</Title>
        </CustomException>
      </detail>
    </s:Fault>
  </s:Body>
</s:Envelope>

A soap envelope returns a fault element that contains a CustomException element.


No comments:

Post a Comment