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 ...
随机推荐
- PHP7安装笔记
PHP7安装笔记 时间 -- :: 喵了个咪 原文 http://www.hdj.me/php7-install-note 主题 PHP # 安装mcrypt yum install -y php-m ...
- myeclipse 10的破解以及运行run.bat错误或者双击立即消失的问题
安装包下载: ed2k://|file|[myeclipse.10.0.更新发布].myeclipse-10.0-offline-installer-windows.exe|947752488|73b ...
- iOS第三方(显示视图的宽度高度)- MMPlaceHolder
github:https://github.com/adad184/MMPlaceHolder#readme appDelegate添加,影响全局 [MMPlaceHolderConfig defau ...
- POJ 2001
#include<iostream> using namespace std; ; struct trienode { trienode * next[kind]; int branch; ...
- hdu 4068 SanguoSHA
搜索下就可以了…… 代码如下: #include<iostream> #include<cstring> #include<cstdio> #include< ...
- http://www.cnblogs.com/draem0507/archive/2013/02/01/2889317.html
http://www.cnblogs.com/draem0507/archive/2013/02/01/2889317.html
- Linux下配置JDK与Tomcat
一.下载安装对应的jdk,并配置Java环境. 官网下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-down ...
- centOS学习part1:操作系统安装
0 linux作为服务器的主要操作系统,在处理速度以及安全性上都要优于windows,虽然需要很多命令要记,但是一般常用的命令不多,用多了就熟悉了,而且现在很多都要图形界面,也降低了学习成本. cen ...
- 检查和收集 Linux 硬件信息的 7 个命令
http://blog.sae.sina.com.cn/archives/3910 在Linux系统中,有许多命令可用于查询主机的硬件信息.一些命令只针对特定的硬件组件,比如CPU.内存,一些命令可以 ...
- 【转】SIP 中的Dialog,call,session 和 transaction
如果你对Sip协议中Call, Dialog, Transaction和Message之间的关系感觉到迷惑,那么,那么我可以告诉你,你并不孤单,因为大多数初学者对于这些名词之间的关系都会感到疑惑. ...