What is <readerQuotas> in WCF binding?

I went through this MSDN link but could not get enough information

Can someone explain to me the scenario where and why I need to set this value.

I came across a setting when I tried to send a Data Contract object to a service method and received an exception. The remote server returned an error: not found. ,

My data contract has a List <> property and got an exception if the list contains 7 objects that worked perfectly with 6 objects.

I assume this is a data contract issue.

When I changed the binding in the configuration file

<readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" /> 

to

 <readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" /> 

The Data Contract object has reached the Service for processing.

+7
source share
1 answer

ReaderQuota parameters are used to limit bindings, as indicated in the attributes. If the request exceeds any of these restrictions, the WCF service will automatically reject the request (very low on the lump stack, which I believe) to make the request as little as possible.

The idea is that the service captures as few resources as possible to service the request (if it exceeds the specified limit), to help distract yourself from the “Refusal to Use”, Service Attacks - DDOS .

Note that readQuota limits can be set both on the server and on the client. This allows you to protect clients from fraudulent servers, as well as protect servers.

+8
source

All Articles