The maximum message size quota for incoming messages (65536) has been exceeded - set maxReceivedMessageSize="2147483647" updated but not working - wcf

added maximum size on web config, but still showing the same error.
ERROR IMAGE

You need to set maxReceivedMessageSize both in your server-side and client-side. The code like this:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxBufferSize="64000000" maxReceivedMessageSize="2147483647" />
</basicHttpBinding>
</bindings>
</system.serviceModel>

Related

Message size quota exceeded on WCF netTcpBinding in remote machine

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.
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.

Sending large file (>10 MB) through WCF rest service

Previously I am sending file (less than 63 KB ) through WCF Rest service then it send successfully but when the file size is greater than 65 KB, it throws an exception. After that I configure the web.config file like below and it works fine.
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="10485760">
<readerQuotas/>
</binding>
</webHttpBinding>
</bindings>
Now i am sending 10 MB file and also increase the size in web.config file but got the same exception.
I added below configuration setting :
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" >
<readerQuotas maxStringContentLength="525288"></readerQuotas>
</binding>
</webHttpBinding>
</bindings>
What is needed to fix this?
I guess you receive this error on client side. remember you have to set the max size at client side!!!
Read Derek's answer. Thats really helpfull.

How to increase maxReceivedMessageSize

i have wcf service and i am sending large streams from service to client.
this is my code in client web config
<bindings>
<basicHttpBinding>
<binding name="Blabla" allowCookies="true"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="32"
maxArrayLength="2147483647"
maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
when i wanted to set maxReceivedMessageSize to more than 2 gb, i get an error. it says "int32 value can not initialize that value". Is it possible to set it to 40 gb or bigger value?
maxReceivedMessageSize can be set to more than int.MaxValue, but only if the transfer mode of the binding is set to Streamed. You should also not set maxBufferSize to 2GB, otherwise you may get a huge memory usage in the client.

timeout error from windows workflow

When i call an recevive activity in Workflow, it is showing timeout error after 1 minute.
I tried to increase the timeout by modifying the web.config as follows, but no use.
<bindings>
<basicHttpBinding>
<binding name="longTimeoutBinding" closeTimeout="10:01:00" openTimeout="10:01:00" maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="10:10:00" sendTimeout="10:10:00" >
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
I have similar problem with one of WCF service also when it fectes large number of data.
Can anyone help me to find out what i am missing here.
Have you also set these values on the client side? It could be that the client gives up waiting for a reply.
Could you try and reduce the timeout to 15 seconds to verify that these configs are the ones that are used.
Could you also post the exception that you get

WCF REST Service Template 4.0 "Bad Request"

I am trying to send a large json string to a WCF Service created with the WCF REST Service Template. If the string is longer 8000 characters I get a "HTTP/1.1 400 Bad Request" error. I have tried added this to my web config:
<bindings>
<webHttpBinding>
<binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"/>
</webHttpBinding>
</bindings>
Any ideas?
You must also setup readerQuotas if you want to pass large strings:
<bindings>
<webHttpBinding>
<binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="50000" />
</binding>
</webHttpBinding>
</bindings>