WCF常见异常-The maximum string content length quota (8192) has been exceeded while reading XML data
异常信息:The maximum string content length quota (8192) has been exceeded while reading XML data
问题:调用第三方的WCF服务,产生上述异常信息
分析:
在公布WCF host端时,要确保host端以及客户端的设置允许一定大小的数据传输。
如果未设置传输大小,maxStringContentLength默认大小为8192。
1)如果第三方服务未设置maxStringContentLength或者设置的maxStringContentLength小于我们调用第三方WCF服务返回的传输信息,则会产生上述异常。
这种情况,我们可以联系第三方将maxStringContentLength的值设置大一些。
2)如果调用方未设置maxStringContentLength或者设置的maxStringContentLength小于我们调用WCF服务返回的传输信息,也会产生上述异常。
这种情况只需在我们的配置文件中将maxStringContentLength修改为合适的大小即可
解决方案:
首先,确定是客户端还是host端的限制。如果是客户端的限制,在客户端修改;如果是host端(自己项目的或者第三方的)的限制,在host端修改
然后,修改配置文件:
<binding name="服务endpoint节点对应的bindingConfiguration值" openTimeout="00:05:00" receiveTimeout="00:05:00" sendTimeout="00:05:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="655360000" maxBufferPoolSize="5242880000" maxReceivedMessageSize="655360000" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="320" maxStringContentLength="655360000" maxArrayLength="163840" maxBytesPerRead="40960" maxNameTableCharCount="163840" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
代码:maxStringContentLength="655360000" ,需要根据WCF服务传输信息的长度自行设置。
WCF常见异常-The maximum string content length quota (8192) has been exceeded while reading XML data的更多相关文章
- The maximum string content length quota (8192) has been exceeded while reading XML data
原文:The maximum string content length quota (8192) has been exceeded while reading XML data 问题场景:在我们W ...
- 调用WebServiceWebService提示The maximum string content length quota (8192) has been exceeded while reading XML data的解决办法
在web.config中,bindings节点下,对应的服务名称中,原本可能是自动折叠的“/>”,需要改成手动折叠的</binding>,然后在中间加上<readerQuota ...
- [Bug]The maximum array length quota (16384) has been exceeded while reading XML data.
写在前面 在项目中,有客户反应无法正常加载组织结构树,弄了一个测试的程序,在日志中查看到如下信息: Error in deserializing body of reply message for o ...
- WCF服务接口多,客户端在引用时出错!报WCF The maximum nametable character count quota (16384) has been exceeded while reading XML data错误
WCF服务接口多,客户端在引用时出错!报WCF The maximum nametable character count quota (16384) has been exceeded while ...
- 【转】Hibernate 常见异常
转载地址:http://smartan.iteye.com/blog/1542137 Hibernate 常见异常net.sf.hibernate.MappingException 当出 ...
- Hibernate 常见异常
Hibernate 常见异常net.sf.hibernate.MappingException 当出现net.sf.hibernate.MappingException: Error r ...
- String Matching Content Length
hihocoder #1059 :String Matching Content Length 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 We define the ...
- salesforce 零基础学习(五十四)常见异常友好消息提示
异常或者error code汇总:https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_con ...
- orcal 数据库 maven架构 ssh框架 的全xml环境模版 及常见异常解决
创建maven项目后,毫不犹豫,超简单傻瓜式搞定dependencies(pom.xml 就是maven的依赖管理),这样你就有了所有你要的包 <project xmlns="http ...
随机推荐
- 在JavaScript中判断整型的N种方法
原文:http://www.cnblogs.com/YcYYcY/p/3759184.html 整数类型(Integer)在JavaScript经常会导致一些奇怪的问题.在ECMAScript的规范中 ...
- ios设备突破微信小视频6S限制的方法
刷微信朋友圈只发文字和图片怎能意犹未竟,微信小视频是一个很好的补充,音视频到位,流行流行最流行.但小视频时长不能超过6S,没有滤镜等是很大的遗憾.but有人突破限制玩出了花样,用ios设备在朋友圈晒出 ...
- vuforia 结合 unity3d 开发 AR 的 androidAPP 总结
原地址:https://software.intel.com/zh-cn/blogs/2014/07/09/vuforia-unity3d-ar-androidapp/?utm_campaign=CS ...
- ASP.NET母版页与内容页相对路径的问题
1. 图片问题 图片显示问题:<img runat="server" src="~/images/ad468x60.gif" alt="&quo ...
- 后缀树系列一:概念以及实现原理( the Ukkonen algorithm)
首先说明一下后缀树系列一共会有三篇文章,本文先介绍基本概念以及如何线性时间内构件后缀树,第二篇文章会详细介绍怎么实现后缀树(包含实现代码),第三篇会着重谈一谈后缀树的应用. 本文分为三个部分, 首先介 ...
- Activity学习(五)——Bundle机制
上一篇文章我简单介绍了Activity之间简单切换,很简单,这一篇文章我们继续聊Android中程序页面互相跳转的Activity,不过这一次我们在Activity跳转时,携带一些简单的数据,然后在新 ...
- 深入浅出ES6(九):学习Babel和Broccoli,马上就用ES6
作者 Jason Orendorff github主页 https://github.com/jorendorff 现在,我们将向你分步展示如何做到的这一切.上面提及的工具被称为转译器,你可以将它 ...
- DBCP参数介绍
参数分步介绍1)数据库连接相关 username="v10" password="v10" driverClassName="ora ...
- UVA 11806 Cheerleaders dp+容斥
In most professional sporting events, cheerleaders play a major role in entertaining the spectators. ...
- C连接oracle(PROC*C)
1. 安装oralce 10g 2.建立数据库和用户 配置VS2005环境 proc需要嵌入式环境 在C/C++常规里面加入 D:\oracle\product\10.2.0\db_1\precom ...