WCF 远程服务器返回了意外响应: (413) Request Entity Too Large。

邓燕华 2015-12-03 04:16:30
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false 并删除上面的元数据终结点 -->
<serviceMetadata httpGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="LargeDataTransferServicesBinding" maxBufferPoolSize="2147483647000" maxBufferSize="2147483647" maxReceivedMessageSize="214748364700"
messageEncoding="Text" transferMode="Buffered" sendTimeout="00:10:00" />
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

</configuration>


各位大神帮帮忙,我这样设置都还不行
...全文
604 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
G_Change 2016-07-27
  • 打赏
  • 举报
回复
我的服务端设置是: <bindings> <basicHttpBinding> <binding name="myWCFBind" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" openTimeout="00:30:00" sendTimeout="00:30:00" closeTimeout="00:30:00" receiveTimeout="00:30:00"> <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> </basicHttpBinding> </bindings> 客户端设置是: EndpointAddress address = new EndpointAddress(pUrl); Binding bindinginstance = null; BasicHttpBinding ws = new BasicHttpBinding(); ws.MaxReceivedMessageSize = 2147483647; ws.MaxBufferSize = 2147483647; ws.MaxBufferPoolSize = 2147483647; ws.ReaderQuotas.MaxArrayLength = 2147483647; ws.ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas() { MaxDepth = 2000000, MaxStringContentLength = 2147483647, MaxBytesPerRead = 2147483647, MaxNameTableCharCount = 2147483647, MaxArrayLength = 2147483647 }; ws.SendTimeout = TimeSpan.FromMinutes(20); ws.ReceiveTimeout = TimeSpan.FromMinutes(20); ws.CloseTimeout = TimeSpan.FromMinutes(20); ws.OpenTimeout = TimeSpan.FromMinutes(20); bindinginstance = ws; 在调试的时候可以正常运行,在执行的时候不可以。 已经有 <system.web> <httpRuntime maxRequestLength="102400"/> <compilation debug="true" /> </system.web> 求指点
geomug 2016-02-22
  • 打赏
  • 举报
回复
服务端修改。 <bindings> <basicHttpBinding> <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text"> <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> </basicHttpBinding> </bindings>
lvfeng_95 2015-12-03
  • 打赏
  • 举报
回复
引用 4 楼 D493829844 的回复:
[quote=引用 2 楼 lvfeng1989 的回复:] .net默认只能传4M的文件,所以尽管设定了Wcf两端的配置,还是超不出.net的限定,所以如果要传输大文件,还需要在System.Web节下加上 <httpRuntimemaxRequestLengthhttpRuntimemaxRequestLength="102400" />
虽然你没有帮我解决问题 不过我已经解决问题了,分就给你哈[/quote] 是什么问题能说说吗?怎么解决的
邓燕华 2015-12-03
  • 打赏
  • 举报
回复
引用 2 楼 lvfeng1989 的回复:
.net默认只能传4M的文件,所以尽管设定了Wcf两端的配置,还是超不出.net的限定,所以如果要传输大文件,还需要在System.Web节下加上 <httpRuntimemaxRequestLengthhttpRuntimemaxRequestLength="102400" />
虽然你没有帮我解决问题 不过我已经解决问题了,分就给你哈
邓燕华 2015-12-03
  • 打赏
  • 举报
回复
http://www.cnblogs.com/Gyoung/p/3369316.html
邓燕华 2015-12-03
  • 打赏
  • 举报
回复
[quote=引用 2 楼 lvfeng1989 的回复:] .net默认只能传4M的文件,所以尽管设定了Wcf两端的配置,还是超不出.net的限定,所以如果要传输大文件,还需要在System.Web节下加上 <httpRuntimemaxRequestLengthhttpRuntimemaxRequestLength="102400" /> 还是不行,我传输的数据也没有4M
lvfeng_95 2015-12-03
  • 打赏
  • 举报
回复
.net默认只能传4M的文件,所以尽管设定了Wcf两端的配置,还是超不出.net的限定,所以如果要传输大文件,还需要在System.Web节下加上 <httpRuntimemaxRequestLengthhttpRuntimemaxRequestLength="102400" />
邓燕华 2015-12-03
  • 打赏
  • 举报
回复
在线等

110,499

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧