locked
WCF MaxItemsInObjectGraph value setting does not have effect when running wcf service on Windows 2008 Standard R2 RRS feed

  • Question

  •  Hi,

    I Have an issue with WCF with MaxItemsInObjectGraph  setting. When exchanged message between client and wcf service exceed 64k i got an error that the message cannot exceed the size of 64k.  But MaxItemsInObjectGraph   both in client and server is set to 2147483646. The problem happens only when the service is running under Windows 2008 Standard R2. If i change the server (different to Windows 2008 Standard R2) the error goes away. Any idea how i can get rid of that issue? It seems the setting does not have effect on that specific server and i tried to change to another Windows 2008 Standard R2 and i got the same error.

    Thank you very much for your precious help.

    Alino.


    Monday, September 14, 2015 1:49 PM

Answers

  • Hi Alinoson,

    According to this case, if you not set maxReceivedMessageSize in your web.config file of server-side

    and client. And you want to send a message which is larger than 64k. Then it will got the error.

    Because, the maxReceivedMessageSize default size is 65536 bytes. So, I suggest you need

    to set maxReceivedMessageSize in your web.config, like below:

    bindings>  
              <wsHttpBinding>  
               <binding name="BindingCD" receiveTimeout="00:10:00" closeTimeout="00:05:00" openTimeout="00:05:00" sendTimeout="00:05:00"  
                        maxBufferPoolSize="1048576000" maxReceivedMessageSize="1048576000" >  
    
     

    client:

    <bindings>  
          <wsHttpBinding>  
            <binding name="WSHttpBinding_ISettingServ" closeTimeout="00:01:00"  
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"  
                bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"  
                maxBufferPoolSize="524288000" maxReceivedMessageSize="65536000">  
    

    For more information, please refer to the following articles:

    1.Transferring large blobs of data with WCF

    I hope that will be helpful to you.

    Best Regards,

    Grady

    • Proposed as answer by Grady_Dong Friday, September 18, 2015 9:03 AM
    • Marked as answer by Grady_Dong Thursday, September 24, 2015 12:38 AM
    Tuesday, September 15, 2015 2:01 AM