wcf Request Entity Too Large 错误
Posted tcli
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了wcf Request Entity Too Large 错误相关的知识,希望对你有一定的参考价值。
今天试着使用wcf上传文件,大小为2.4MB就报错了,报Request Entity Too Large错误。
修改配置文件,增加bindings设置,修改binding 的maxReceivedMessageSize设置,如下所示
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding closeTimeout="00:10:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
</basicHttpBinding>
</bindings>
<protocolMapping>
<add binding="basicHttpBinding" scheme="http" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
以上是关于wcf Request Entity Too Large 错误的主要内容,如果未能解决你的问题,请参考以下文章
WCF服务端返回:(413) Request Entity Too Large
远程服务器返回了意外相应:(413) Request Entity Too Large。
UploadReadaheadsize 值已更改,但未解决 Request Entity too large 错误
http错误-413 Request Entity Too Large