c# - WCF 服务 : (413) Request Entity Too Large 返回意外响应

标签 c# wcf web-config

我已经使用 WCF 实现了一小组 REST 服务。其中一项服务接收大量数据。调用它时(这是从 visual studio 运行它时——我还没有将它部署到生产服务器上)我收到错误

The remote server returned an error: (413) Request Entity Too Large.

我的网络配置

<binding name="BasicHttpBinding_ISalesOrderDataService" 
         closeTimeout="00:10:00"
         openTimeout="00:10:00" 
         receiveTimeout="00:10:00" 
         sendTimeout="00:10:00"
         allowCookies="false" 
         bypassProxyOnLocal="false" 
         hostNameComparisonMode="StrongWildcard"
         maxBufferPoolSize="2147483647" 
         maxBufferSize="2147483647" 
         maxReceivedMessageSize="2147483647"
         textEncoding="utf-8" 
         transferMode="Buffered" 
         useDefaultWebProxy="true"
         messageEncoding="Text">
  <readerQuotas maxDepth="2000000" 
                maxStringContentLength="2147483647"
                maxArrayLength="2147483647" 
                maxBytesPerRead="2147483647"
                maxNameTableCharCount="2147483647" />
  <security mode="None">
    <transport clientCredentialType="None" 
               proxyCredentialType="None" 
               realm="" />
    <message clientCredentialType="UserName" 
             algorithmSuite="Default" />
  </security>
</binding>

最佳答案

似乎您超出配额增加了这些值(value)。

 maxReceivedMessageSize="2000000" maxBufferSize="2000000">

(或尽可能检查您的查询以获得较低的结果)

如果没有任何效果,请检查这里,这是常见问题。

The remote server returned an error: (413) Request Entity Too Large

关于c# - WCF 服务 : (413) Request Entity Too Large 返回意外响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32866701/

相关文章:

c# - 动态创建的文本框不更新

c# - 泛型方法中的 InvalidCastException

.net - Web 服务更改方法响应而不通知客户端

iis - 使用 Web.Config 将目录重定向到子域

iis - 使用 Powershell 配置 IIS - 启用表单例份验证

c# - 锁定数据对象的最佳实践

c# - 获取没有查询参数的当前页面 URL - Razor Html 助手?

WCF 跨多个客户端共享 IClientMessageInspector 实例

wcf - 通过代理服务器连接到 WCF 服务时出现奇怪的异常

c# - 使用 Forms 身份验证首次登录 ASP.NET MVC 后强制用户更改密码