【问题标题】:WCF REST Service Template 4.0 "Bad Request"WCF REST 服务模板 4.0“错误请求”
【发布时间】:2011-09-13 12:43:17
【问题描述】:

我正在尝试向使用 WCF REST 服务模板创建的 WCF 服务发送一个大的 json 字符串。如果字符串超过 8000 个字符,我会收到“HTTP/1.1 400 Bad Request”错误。我已经尝试将此添加到我的网络配置中:

    <bindings>
        <webHttpBinding>
            <binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"/>
        </webHttpBinding>
    </bindings>

有什么想法吗?

【问题讨论】:

    标签: wcf wcf-binding


    【解决方案1】:

    如果你想传递大字符串,你还必须设置readerQuotas

    <bindings>
        <webHttpBinding>
            <binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
               <readerQuotas maxStringContentLength="50000" />
            </binding>
        </webHttpBinding>
    </bindings>
    

    【讨论】:

      猜你喜欢
      • 2011-09-29
      • 1970-01-01
      • 2013-06-22
      • 2017-08-16
      • 1970-01-01
      • 2011-09-09
      • 2011-06-29
      • 2014-11-11
      • 1970-01-01
      相关资源
      最近更新 更多