none
Large Data from WCF service RRS feed

  • General discussion

  • Hi All

    I am using basicHttpBinding and one of my Method returns List<T> which has over 5000 records.

    I tried setting the maxBufferSize and maxReceivedMessageSize to "2147483647" but

    I still get the Proxy Disconnected (due to large size) exception.

    If I return a smaller list (about 500) it goes through fine.

    I tried Streamed behavior too, but Binary/Xml De-serialization fails at client side...

    (Xml deserialization says: No Root Element)...

    Looking for suggestions on how to send Large Data using WCF.

    Friday, May 10, 2013 6:20 PM

All replies

  • On 5/10/2013 2:20 PM, Prateek_Shrivastava wrote:

    Hi All

    I am using basicHttpBinding and one of my Method returns List<T> which has over 5000 records.

    I tried setting the maxBufferSize and maxReceivedMessageSize to "2147483647" but

    I still get the Proxy Disconnected (due to large size) exception.

    If I return a smaller list (about 500) it goes through fine.



    I tried Streamed behavior too, but Binary/Xml De-serialization fails at client side...

    (Xml deserialization says: No Root Element)...

    Looking for suggestions on how to send Large Data using WCF.

    You have to make the change to the client and service side config files, if you have not done so. And to make the change on the service side, you have to make a new binding and give the changes to the new binding.

    Saturday, May 11, 2013 4:52 PM
  • Refer

    http://angadbhat.com/2011/11/9/the-maximum-string-content-length-quota-(8192)-has-been-exceeded.aspx

    It is required to update the service and client configuration as explained in above response / and the URL.


    Apriori algorithm [association rule]

    Saturday, May 11, 2013 5:29 PM
  • No Guys

    String length isnt my problem.

    System.ServiceModel.CommunicationException was caught
      Message=An error occurred while receiving the HTTP response to XXXXXX. 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). 

    This is the Exception I get. If I reduce my collection size, it runs flawlessly.

    I guess I will have to look into Streaming data again.

    Sunday, May 12, 2013 5:55 PM
  • On 5/12/2013 1:55 PM, Prateek_Shrivastava wrote:

    No Guys

    String length isnt my problem.System.ServiceModel.CommunicationException was caught
       Message=An error occurred while receiving the HTTP response to XXXXXX. 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).




    This is the Exception I get. If I reduce my collection size, it runs flawlessly.

    I guess I will have to look into Streaming data again.

    You have a couple of other settings than can be maxed-out. You should set all of them to their max settings.

    Sunday, May 12, 2013 9:00 PM
  • Hi Prateek,

    In addition to the max received message size on binding configuration, you can also try adjust the reader quotas and also the data contract serializer's object graph size limit for you WCF service (both server and client). Here are existing threads mentioned these settings:

    #WCF large message. The maximum string content length quota (8192) has been exceeded while reading XML data. 

    http://social.msdn.microsoft.com/Forums/zh-CN/wcf/thread/02682b82-935b-4f87-a8df-8fdc6adaedd4

    #WCF - How to Increase Message Size Quota
    http://stackoverflow.com/questions/884235/wcf-how-to-increase-message-size-quota


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 13, 2013 5:22 AM
    Moderator
  • Hi Prateek,

    In addition to the max received message size on binding configuration, you can also try adjust the reader quotas and also the data contract serializer's object graph size limit for you WCF service (both server and client). Here are existing threads mentioned these settings:

    #WCF large message. The maximum string content length quota (8192) has been exceeded while reading XML data. 

    http://social.msdn.microsoft.com/Forums/zh-CN/wcf/thread/02682b82-935b-4f87-a8df-8fdc6adaedd4

    #WCF - How to Increase Message Size Quota
    http://stackoverflow.com/questions/884235/wcf-how-to-increase-message-size-quota


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Hi Steven

    Thanks for the response... Though I figured it after a lot of search.

    Just for persisting this.... Guys the fix needed was:

    <endpointBehaviors>
            <behavior name="StreamingEndpoint">
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </endpointBehaviors>

    @Steven: I dont see Mark as Answer option for your post...otherwise would have marked it.

    Monday, May 13, 2013 2:13 PM