locked
Getting error when I request large data from WCF service and return it as DataTable RRS feed

  • General discussion

  • I am getting below error when I tries to get large data from database:

    Error Message:An error occurred while receiving the HTTP response to "my service URL". 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.

    Stack Trace:

    Server stack trace:

    Server stack trace: 
    at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
    at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    I tried following things:

    1. Increase size of maxBufferSize, maxReceivedMessageSize, maxStringContentLength and maxArrayLength however it does not help.

    <bindings>
            <basicHttpBinding>
              <binding name="BasicHttpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="01:50:00" openTimeout="01:50:00" sendTimeout="01:50:00" receiveTimeout="01:50:00" >
                <readerQuotas maxDepth="128" maxStringContentLength="8388608" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              </binding>
            </basicHttpBinding>
          </bindings>

    2.  Added httpRuntime tag in web.config

    <httpRuntime maxRequestLength="2097151" executionTimeout="12000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100"/>

    3. I also added maxItemsInObjectGraph in my web.config. This also does not help me.

    <dataContractSerializer ignoreExtensionDataObject="false" maxItemsInObjectGraph="2147483646" />

    Can anyone please tell me what else I can do to resolve this issue.

    Thanks in Advance

    Amit 

    Friday, May 11, 2012 1:20 PM

All replies

  • The config file you are showing is on the client-side. You are sending
    the data back to the service-side. So you have to change the
    service.side bindings to match the client-side bindings.
     You do on the service-side by making a custom bindings that matchs the
    client-side bindings, and you point the service to the custom bindings.
     
     
    Friday, May 11, 2012 1:36 PM
  • That is not a good pratices to change server configuration to match client side binding. 

    enable your server side trace log. it will give you real error message.  

    Tuesday, May 15, 2012 10:12 PM