locked
how to get large data via WFC RRS feed

  • Question

  • Hello Experts,

    I am trying to retreive large amount of data (around 3000 record from DB) via WFC. and it gives error to increase the max amount.
    I increased maxReceivedMessageSize to be 6553600 and also maxBufferSize to be 6553600 with no good :( still WFC gives me error . what should I do !!
    Friday, January 22, 2010 5:22 PM

Answers

  • Try the following:

    At the service side config:
         <serviceBehaviors>
            <behavior name="Services.ServiceInterface.SearchServiceBehavior">          
                        <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </serviceBehaviors>

    At the client side config:
         <endpointBehaviors>
            <behavior name="FASTServiceBehaviour">         
              <dataContractSerializer  maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </endpointBehaviors>

    See if it helps.


    Josku
    • Marked as answer by Riquel_Dong Friday, January 29, 2010 8:39 AM
    Saturday, January 23, 2010 1:19 AM
  • well remember its max *objects* in graph so you are assuming that your 3000 *rows* maps to less than 10000 objects which wouldn't be true if weach row of data had 4 strings in it. You don;t say how you are receiving the data (how the data is structured) but, for example, a DataSet could have substantially more *objects* in the graph

    Try changing the value to, say, 500,000 to see if this value is the critical one - if it then works reduce the value to a more reasonable one that allows your 3000 rows and then add say 50% to allow for some growth in data either in the width of a record or the number of rows
    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    • Marked as answer by Riquel_Dong Friday, January 29, 2010 8:39 AM
    Saturday, January 23, 2010 11:37 AM
  • Hi Developer2006,

    Do you specify the bigMsg behavior to the endpoint in your configuration file?

         <client>
                <endpoint address="net.tcp://10.172.18.99:8010/MetadataSample" 
                          behaviorConfiguration="bigMsg"                    
                    binding="netTcpBinding" bindingConfiguration="TcpBinding"
                    contract="ServiceReference1.ISimpleService" name="TcpBinding">              
                </endpoint>
            </client>

    <behaviors>
            <endpointBehaviors>

              <behavior name="bigMsg">
                <dataContractSerializer maxItemsInObjectGraph="100001 "/>
               
              </behavior>
            </endpointBehaviors>
          </behaviors>


    Best regards,
    Riquel
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Riquel_Dong Friday, January 29, 2010 8:39 AM
    Wednesday, January 27, 2010 7:12 AM

All replies

  • You're probably hitting the maxObjectInGraph which you can change with the DataContractBehavior - I showed how to do this in a screencast a while back about working with larrge messages. I recorded two - one for buffered messages and one for streamed

    http://rocksolidknowledge.com/ScreenCasts.mvc


    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    Friday, January 22, 2010 6:45 PM
  • Which one ?
    Thanks.

    Friday, January 22, 2010 8:45 PM
  • ok.. see my case.. I have created a webservice project, and I am adding these webservies  (not WFC) to my asp.net project as "Service Reference",
    so WFC sections will be added to the webconfig file because I am adding it as service reference.

    in your vedio, I need to add some sectoins on the config file of the service project, but in my case I am using webservice project nor WFC project? so what should I do ?
    Thanks.
    Friday, January 22, 2010 11:04 PM
  • Try the following:

    At the service side config:
         <serviceBehaviors>
            <behavior name="Services.ServiceInterface.SearchServiceBehavior">          
                        <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </serviceBehaviors>

    At the client side config:
         <endpointBehaviors>
            <behavior name="FASTServiceBehaviour">         
              <dataContractSerializer  maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </endpointBehaviors>

    See if it helps.


    Josku
    • Marked as answer by Riquel_Dong Friday, January 29, 2010 8:39 AM
    Saturday, January 23, 2010 1:19 AM
  • OK so only the client is WCF? In that case, as the screencast says, you still need to add the dataContractSerializer behavior as an endpoint behavior and set the maxItemsInObjectGraph there
    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    Saturday, January 23, 2010 7:28 AM
  • Hello Richard,

    I did what you say and it still not working :(

    I added the below section on the webconfig file in the client side

    <behaviors>
            <endpointBehaviors>

              <behavior name="bigMsg">
                <dataContractSerializer maxItemsInObjectGraph="100001"/>
               
              </behavior>
            </endpointBehaviors>
          </behaviors>

     

    Saturday, January 23, 2010 11:08 AM
  • well remember its max *objects* in graph so you are assuming that your 3000 *rows* maps to less than 10000 objects which wouldn't be true if weach row of data had 4 strings in it. You don;t say how you are receiving the data (how the data is structured) but, for example, a DataSet could have substantially more *objects* in the graph

    Try changing the value to, say, 500,000 to see if this value is the critical one - if it then works reduce the value to a more reasonable one that allows your 3000 rows and then add say 50% to allow for some growth in data either in the width of a record or the number of rows
    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    • Marked as answer by Riquel_Dong Friday, January 29, 2010 8:39 AM
    Saturday, January 23, 2010 11:37 AM
  • oh - also remember you have to reference the behavior block from the endpoint as well otherwise it isn;t used
    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    Saturday, January 23, 2010 11:38 AM
  • I am retreving list(of object) from the webservice, I set <dataContractSerializer maxItemsInObjectGraph="500000"/> and it still not working
    Saturday, January 23, 2010 1:32 PM
  • ok so are you sure its a size issue? You haven;t said exactly what error you are seeing. Can you give full details of the error?


    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    Saturday, January 23, 2010 5:05 PM
  • Here is the error message

    "The maximum message size quota for incoming messages (6553600) has been
    exceeded. To increase the quota, use the MaxReceivedMessageSize property on
    the appropriate binding element. "
    Sunday, January 24, 2010 11:32 AM
  • OK well it looks like your current value for MaxRecevedMessageSize isn't big enough - have you tried increasing it to a very high value? Say 400,000,000? How much data is in each of these 3000 rows?
    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    Sunday, January 24, 2010 9:24 PM
  • yes I tried, with no good
    Sunday, January 24, 2010 10:20 PM
  • Hi Developer2006,

    Do you specify the bigMsg behavior to the endpoint in your configuration file?

         <client>
                <endpoint address="net.tcp://10.172.18.99:8010/MetadataSample" 
                          behaviorConfiguration="bigMsg"                    
                    binding="netTcpBinding" bindingConfiguration="TcpBinding"
                    contract="ServiceReference1.ISimpleService" name="TcpBinding">              
                </endpoint>
            </client>

    <behaviors>
            <endpointBehaviors>

              <behavior name="bigMsg">
                <dataContractSerializer maxItemsInObjectGraph="100001 "/>
               
              </behavior>
            </endpointBehaviors>
          </behaviors>


    Best regards,
    Riquel
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Riquel_Dong Friday, January 29, 2010 8:39 AM
    Wednesday, January 27, 2010 7:12 AM