Search code examples
wcfbasichttpbinding

WCF- Method unable to generate response. Is there any length limit for response header?


I have a WCF method returning custom list of objects and its about 20K records. Everything is working fine on my local machine but on live server method is unable to produce any response. I am using below binding configs:

<bindings>
      <basicHttpBinding>
        <binding name="NewBinding0" closeTimeout="00:10:00" openTimeout="00:10:00"
          sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
          maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
      </basicHttpBinding>
    </bindings>

Could anyone help me to fix this?

Kind Regards, Micky


Solution

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

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