【问题标题】:The remote server returned an unexpected response: (413) Request Entity Too Large in WCF [duplicate]远程服务器返回了意外响应:(413)WCF 中的请求实体太大 [重复]
【发布时间】:2014-12-18 06:08:34
【问题描述】:

当我尝试使用 Tinymce 编辑器保存大文本时,我的 WCF 服务出现问题, 它说 远程服务器返回了意外响应:(413) Request Entity Too Large.

最大尺寸已经在配置中,我这里还有什么遗漏吗?

提前致谢。

端点正在跟踪,

<endpoint name="LabServiceEndPoint" address="***" binding="basicHttpBinding" contract="EasternLabs.Common.Contract.ServiceContracts.ILabServices" bindingConfiguration="Binding1" />

我的绑定,

<basicHttpBinding>
        <binding name="Binding1" hostNameComparisonMode="StrongWildcard" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" transferMode="Buffered" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="false" useDefaultWebProxy="true">
          <security mode="None" />
          <readerQuotas
                 maxDepth="2147483647"
                 maxStringContentLength="2147483647"
                 maxArrayLength="2147483647"
                 maxBytesPerRead="2147483647"
                 maxNameTableCharCount="2147483647" />
        </binding>
      </basicHttpBinding>

【问题讨论】:

  • 可能您应该拆分您的 LARGE TEXT,因为它清楚地表明 REQUEST 实体太大。这样做也会有好处。
  • 没有任何解决方法可以让它在不夹板文本的情况下工作吗?
  • 我想不到。
  • 是REST服务吗???
  • 没有@shankar.parsanamoni

标签: c# wcf


【解决方案1】:

您的配置似乎没问题,所以我认为您的问题是 MaxRequestEntityAllowed

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/468d6cea-04cd-4b10-b1e1-c17b9e909d07.mspx?mfr=true

尝试通过cmd设置

cmd appcmd set config /section:asp /maxRequestEntityAllowed:4294967295

它会将其设置为 4gb - 如果您想要更低的限制,请更改数字。

这对 DoS 不利

【讨论】:

    猜你喜欢
    • 2014-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多