what is <readerQuotas> in WCF Binding?
I gone through this MSDN link but could not get enough details
Can any one explain me with a scenario where and why i need to set this value.
I came across the setting when i was trying to send a Data Contract object to service method and was getting exception The remote server returned an error: Not Found.,
My data contract is having List<>property and was getting exception if list contains 7 object it was working fine with 6 object.
I guess it was issue with Size of Data Contract.
When i changed my binding in config file
<reade开发者_运维知识库rQuotas maxDepth="64" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="4096" />
to
<readerQuotas maxDepth="128" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="4096" />
the Data Contract object reached to Service for processing.
The readerQuota settings are used to limit bindings as specified by the attributes. If a request exceeds any of those limits the WCF service will automatically reject the request (very low on the comms stack I believe) to do as little processing on the request as is possible.
The idea being that the service commit as few resources as possible to service the request (if it exceeds a given limit) to help fend off Denial-of-Service attacks - DDOS.
Note that the readQuota limits can be set on both server and client. This allows clients to be protected against fraudulent servers as well as protecting the servers.
精彩评论