1

Always getting exception "The maximum message size quota for incoming messages has been exceeded for the remote channel. See the server logs for more details", in .net c# wcf windows application development.

Up to approximate 72kb size data in DataTable I am able to send remote machine hosting WCF in windows service successfully. But above that throwing exception "The maximum message size quota for incoming messages has been exceeded for the remote channel. See the server logs for more details".

Already did setup of data size management both end. Client-end App.config:

<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IProjectService" 
maxBufferSize="2147483647" maxBufferPoolSize="524288"
maxReceivedMessageSize="2147483647">          
<readerQuotas maxStringContentLength="2147483647"/>          
</binding>
</netTcpBinding>
</bindings>

Remote server-end App.config:

<netTcpBinding>
<binding name="NetTcpBinding_IProjectService" maxBufferSize="2097152" 
maxBufferPoolSize="2097152"maxReceivedMessageSize="2097152">
<readerQuotas maxStringContentLength="2097152" />
</binding>
</netTcpBinding>

Also tried same sizes i.e."2147483647" both-end but with same exception always.

TNM
  • 11
  • 2
  • _"message size...exceeded"_ is the "NullReferenceException" from an incident reporting point of view for WCF questions on SO. Did you search first? –  Aug 15 '19 at 22:22
  • Possible duplicate of [WCF - How to Increase Message Size Quota](https://stackoverflow.com/questions/884235/wcf-how-to-increase-message-size-quota). Just change http binding to Tcp where appropriate –  Aug 15 '19 at 22:24

1 Answers1

0

Please consider the below configuration.

    <bindings>
      <netHttpBinding>
        <binding name="mybinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647"/>          
        </binding>
      </netHttpBinding>
</bindings>

Moreover, please apply the configuration in the service endpoint by using BindingConfiguration name.

<services>
      <service name="sv">
        <endpoint bindingConfiguration="mybinding" address="" binding="netTcpBinding" contract="isv" ></endpoint>
      </service>
</services>

Please apply the configuration on both the serve-end and the client-end.
Feel free to let me know if the problem still exists.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22
  • Abraham ! The bit "bindingConfiguration="mybinding"" was missing in my service endpoint entry only and that made the whole story changed fundamentally. I was able to post max 72KB of data from DataSet earlier. Just now, I posted 5MB of dataset data to remote WCF service successfully. God bless you Abraham. My holiday will be peaceful now. – TNM Aug 16 '19 at 12:03