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 ...
随机推荐
- \r,\n,\r\n的区别
http://www.studyofnet.com/news/285.html \n是换行,英文是New line,表示使光标到行首\r是回车,英文是Carriage return,表示使光标下移一格 ...
- 在windows7 上安装 Sublime Text 3 及其插件
1.下载地址:http://www.sublimetext.com/3 请根据你的平台,选择适当的安装版本 安装完毕后,设定TAB键为4个空格( Preferences——>Setings-Us ...
- JSON的parse()和stringfy()方法
1.JSON.parse; 作用:将JavaScript对象表示法的JSON字符串转换为对象(字符串转对象). 语法:JSON.parse(text [, reviver]) text 必选. 一个有 ...
- ios如何普安短图片类型
很多时候需要知道服务器返回的图片是.png还是.jpg或者是.git, 两种方式 1,获取扩展名 //图片 NSString *image = @"4351141241.GIT&quo ...
- Google Protocol Buffer 简单介绍
以下内容主要整理自官方文档. 为什么使用 Protocol Buffers .proto文件 Protocol Buffers 语法 编译.proto文件 Protocol Buffers API 枚 ...
- peewee 字段属性help_text的支持问题
至少在__version__ = '2.6.0'的时候,给字段添加help_text的时候,在数据库的ddl语句里面是没有comment的. 看了下源码,顺藤摸瓜,最终定位到了字段(Field类)的_ ...
- rest api设计的一般原则
本文参考自:http://www.ruanyifeng.com/blog/2014/05/restful_api.html,http://www.dongming8.cn/?p=590 服务器端: 1 ...
- django 实战 - eLeave Form
需求: 实现请假单的电子审批 1. 支持国际化 2. 支持模型级别的访问记录 here we go: 这里会写一系列的文章,来记录我实战的过程,由于接触django没多久,难免有疏漏之处,望拍砖不要太 ...
- NUI控件扩展
摘要:NUI组件是公司新一代的前端开发框架,它精致优雅的前端编程模型,是大家能够,或者想接受学习它的重要原因,在使用它的时候,一定不免会想增加自己的控件,让别人也能够如此优雅的使用. 其实NUI的扩展 ...
- visual studio 2012 插件
下面来分享几个好用的插件:直接在Tools-Extensions and Updates-Online中搜索就可以安装了 (中文版位于:菜单-工具-扩展和更新-联机-Visual Studio库) 1 ...