WCF错误:413 Request Entity Too Large
在我们用WCF传输数据的时候,如果启用默认配置,传输的数据量过大,经常会出这个错误。
WCF包含服务端与客户端,所以这个错误可能出现在服务端返回数据给客户端,或客户端传数据给服务端时。
1. 服务端返回数据给客户端报错
在客户端配置文件中,主要是配置maxReceivedMessageSize
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ServiceProxyBinding" closeTimeout="00:10:00" receiveTimeout="00:10:00"
sendTimeout="00:10:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="134217728" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:5239/AHMTService/PartService.svc"
binding="basicHttpBinding" bindingConfiguration="ServiceProxyBinding"
contract="UniCloud.ServiceContracts.IPartService" name="IPartService" />
</client>
</system.serviceModel>
2 客户端传数据给服务端报错
修改服务端web.config,主要也是配置maxReceivedMessageSize
<system.serviceModel>
<services>
<!--DecodeService 服务端配置 增加接收文件大小-->
<service name="UniCloud.Services.DecodeService" behaviorConfiguration="MyServiceBehaviour" >
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="MyServiceBinding" contract="UniCloud.ServiceContracts.IDecodeService">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:5239/AHMTService"/>
</baseAddresses>
</host>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="MyServiceBinding" closeTimeout="00:10:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None"></security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehaviour">
<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
其实要修改所有的服务,不管是服务端还是客户端,Binding那边增加一个没有设置名字的默认配置就OK了
<binding closeTimeout="00:10:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
WCF错误:413 Request Entity Too Large的更多相关文章
- Nginx解决错误413 Request Entity Too Large
最近一个项目当中,要求上传图片,并且限制图片大小,虽然在laravel当中已经添加了相关的表单验证来阻止文件过大的上传,然而当提交表单时,还没轮到laravel处理,nginx就先报错了.当你仔细看报 ...
- jenkins错误413 Request Entity Too Large<
jenkins-nginx--sonar1/sonar2
- WCF错误:413 Request Entity Too Large 的一个解决方法
在我们用WCF传输数据的时候,如果启用默认配置,传输的数据量过大,经常会出这个WCF:413 Request Entity Too Large的错误. WCF包含服务端与客户端,所以这个错误可能出现在 ...
- .netcore 部署时遇到413 Request Entity Too Large 和 413Payload Too Large 的问题
.netcore3.1 遇到一个webapi 上传大文件问题 首先,在kestrel模式调试模式下上传 会报错413, 需要在三个地方添加 1.startup中 这里设置的2g最大值 2.在progr ...
- WCF (413) Request Entity Too Large
有网友碰到过这样的问题:wcf 远程服务器返回了意外响应: (413) Request Entity Too Large. - wsx_net,问题详细内容为:挺不错的博文:wcf 远程服务器返回了意 ...
- Nginx出现413 Request Entity Too Large错误解决方法
Nginx出现的413 Request Entity Too Large错误,这个错误一般在上传文件的时候出现,打开nginx主配置文件nginx.conf,找到http{}段,添加 解决方法就是 打 ...
- Nginx出现“413 Request Entity Too Large”错误解决方法
Nginx出现“413 Request Entity Too Large”错误解决方法 2011-03-25 13:49:55| 分类: 默认分类 | 标签:413 request entit ...
- Nginx 出现413 Request Entity Too Large 错误解决方法(上传大小限制)
| 时间:2013-09-05 20:19:14 | 阅读数:485075 [导读] Nginx出现的413 Request Entity Too Large错误,这个错误一般在上传文件的时候出现,打 ...
- nginx解决超长请求串(413 request Entity too Large错误解决办法)
<div class="hide-article-box text-center" style="display: block;"> <a c ...
- 解决Gitlab的The remote end hung up unexpectedly错误,解决RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large问题
解决Gitlab的The remote end hung up unexpectedly错误 解决RPC failed; HTTP 413 curl 22 The requested URL retu ...
随机推荐
- Eclipse构建Maven项目
1. 安装m2eclipse插件 要用Eclipse构建Maven项目,我们需要先安装meeclipse插件 点击eclipse菜单栏Help->Eclipse Marketpl ...
- Ubuntu 14 编译安装 XDebug - 2.3.3 For PHP - 5.4.45
安装过程如下: 1.下载XDebug源码:http://xdebug.org/files/xdebug-2.3.3.tgz 2.解压到某个目录,如 /opt/software/xdebug-2.3.3 ...
- Swift2.1 语法指南——自动引用计数
原档: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programm ...
- android GestureDetector 手势基础
1. 当用户触摸屏幕的时候,会产生许多手势,例如down,up,scroll,filing等等,我们知道View类有个View.OnTouchListener内部接口,通过重写他的onTouch(Vi ...
- python 临时变量使用心得
在函数里面的临时变量也可以定义为一个函数名.变量名,这样就可以通过对象来访问这个变量了,函数使用完之后不会消除.因为函数也是对象,python里面一切皆为对象.
- 我对自己提的几个关于cocos2dx的几个问题
1.友元函数的定义: 2.运算符重载: 3.内存关机机制: 4.动作侦听: 5.单点触摸: 6.触摸目标判断: 7.事件传递: 8.多点触摸: 9.加速传感器: 10.物理按键交互: 11.绘图API ...
- 基于php的snmp管理端开发
一.系统环境: 操作系统:CentOS 5.4 内核:Linux_2.6 编译环境:gcc 4.1.2 代码版本:php-5.2.8.tar ...
- Caffe学习系列(9):solver优化方法
介绍了各种优化算法 参考:http://www.cnblogs.com/denny402/p/5074212.html
- python入门教程链接
python安装 选择 2.7及以上版本 linux: 一般都自带 windows: https://www.python.org/downloads/windows/ mac os: https:/ ...
- ThinkPHP 知识点链接
1.Thinkphp3.2 行为扩展和插件(Hook) http://www.thinkphp.cn/topic/21323.html 2.ThinkPHP3.1.3的单字母函数汇总 ...