【问题标题】:Bad Request Content length above 8192 not reaching WCF超过 8192 的错误请求内容长度未达到 WCF
【发布时间】:2023-03-03 21:48:02
【问题描述】:

我们有一个服务器(IIS 6.0),托管了 2 个网站

一个是代理,另一个是 WCF RESTful API

现在的问题是,当代理网站访问内容长度超过 8000 的 API 时,例如前 9747 或 8398,它会在代理中给出 400 Bad request,而在 API 中会发生这种情况。

WCF Dispatcher Before Call 未被调用

WCF Dispatcher BeforeSendReply 被调用,内容长度为 0。

我们在绑定中有这个配置

<webHttpBinding >
<binding name="binding1" closeTimeout="00:01:00" openTimeout="00:01:00"
        receiveTimeout="00:10:00" sendTimeout="00:01:00" maxBufferSize="73400320"
        maxBufferPoolSize="73400320"
        maxReceivedMessageSize="73400320"
        transferMode="Buffered"
        useDefaultWebProxy="true">
          <readerQuotas maxDepth="73400320" maxStringContentLength="73400320"
           maxArrayLength="73400320" maxBytesPerRead="73400320" maxNameTableCharCount="73400320" />
          <security mode="None">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
</webHttpBinding>

可以做什么,我猜是内容长度问题

【问题讨论】:

    标签: .net rest iis iis-6


    【解决方案1】:

    我错过了将 binding1 添加到端点中的 bindingConfiguration

    <endpoint address="" binding="webHttpBinding" bindingConfiguration="binding1"
                      contract="RESTService.IService" behaviorConfiguration="web">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-27
      • 1970-01-01
      • 2017-04-08
      • 2012-06-07
      • 1970-01-01
      • 2012-10-08
      • 1970-01-01
      相关资源
      最近更新 更多