Mic Mic - 2 months ago 35
ASP.NET (C#) Question

WCF - Production server only - An error occurred while receiving the HTTP response

I am facing an strange issue on our production server that is

An error occurred while receiving the HTTP response to http://end-http://xxxxx/Main.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

Website and WCF service are deployed on same server and its perfectly working fine on our QA environment but same code & binding settings are not working on production server.

We have below binding settings on WCF service

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding closeTimeout="00:05:00" openTimeout="00:05:00" sendTimeout="00:05:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>


WCF Client

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMain" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://abc/DataService/Main.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IMain" contract="DALService.IMain"
name="BasicHttpBinding_IMain" />
</client>
</system.serviceModel>


Could someone help one me on this to sort out this issue?

Many Thanks
Micky

Mic Mic
Answer

Finally , I have managed to fix it & fix is to add below setting in WCF server config.

 <serviceBehaviors>
        <behavior>
<dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
</behavior>
      </serviceBehaviors> 
Comments