【问题标题】:what is <readerQuotas> in WCF Binding?WCF 绑定中的 <readerQuotas> 是什么?
【发布时间】:2011-06-06 07:48:07
【问题描述】:

I gone through this MSDN link but could not get enough details

谁能解释一下我需要设置这个值的位置和原因。

当我尝试将数据协定对象发送到服务方法并遇到异常时遇到了设置远程服务器返回错误:未找到。

我的数据合同具有 List 属性,如果列表包含 7 个对象,则它与 6 个对象一起工作正常。

我猜这是数据合同大小的问题。

当我在配置文件中更改绑定时

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

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

Data Contract 对象到达 Service 进行处理。

【问题讨论】:

    标签: c# wcf wcf-binding


    【解决方案1】:

    readerQuota 设置用于限制属性指定的绑定。如果请求超过任何这些限制,WCF 服务将自动拒绝该请求(我相信在通信堆栈上非常低),以尽可能少地处理请求。

    这个想法是服务提交尽可能少的资源来服务请求(如果它超过给定的限制)以帮助抵御Denial-of-Service attacks - DDOS

    请注意,可以在服务器和客户端上设置 readQuota 限制。这样可以保护客户端免受欺诈性服务器的侵害并保护服务器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-09
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      • 2010-10-24
      • 1970-01-01
      相关资源
      最近更新 更多