读取XML数据时,已超过最大字符串内容长度配额(8192)。可以通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象上的MaxStringContentLength属
来源:互联网 发布:在淘宝退货卖家拒收 编辑:程序博客网 时间:2024/05/21 14:47
原始异常:
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:CheckedResult. The InnerException message was 'There was an error deserializing the object of type SDTool.VFRService.CheckedResponse. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 18538.'. Please see InnerException for more details. ---> System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type SDTool.IVFRService.CheckedResponse. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 18538. ---> System.Xml.XmlException: The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 18538
原因分析:
在WCF中已经配置如下配置:
<bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IReseiverService" receiveTimeout="00:10:00" closeTimeout="00:05:00" openTimeout="00:05:00" sendTimeout="00:05:00" maxBufferPoolSize="1048576000" maxReceivedMessageSize="1048576000"> <readerQuotas maxDepth="640" maxStringContentLength="1048576000" maxArrayLength="1048576000" maxBytesPerRead="1048576000" maxNameTableCharCount="1048576000"/> <security mode="None"> <message clientCredentialType="UserName"/> </security> </binding> </basicHttpBinding> </bindings>在客户端的配置如下:
<binding name="BasicHttpBinding_IReseiverService" maxReceivedMessageSize="104857600"> </binding>在windows10系统中运行,客户端能正常访问,但是在windows7系统中就会出现上面的异常信息,通过尝试,需在客户端配置与服务端一样的配置。结果如下:
<binding name="BasicHttpBinding_IReseiverService" maxReceivedMessageSize="104857600"> <readerQuotas maxDepth="640" maxStringContentLength="1048576000" maxArrayLength="1048576000" maxBytesPerRead="1048576000" maxNameTableCharCount="1048576000"/> </binding>
在交给客户使用后不久又出现以下问题:
The formatter threw an exception while trying to deseriabize the message:There was an error while trying to deserialize parameter http://tempuri.org/:QueryRecordResult.The InnerException message was'Maxinum number of items that can be serialized or deserialized in an object graph is '65536'.Change the object praph or increase the MaxItemInObjectGraph quota.'.Please see InnerException for more details.
在客户端配置文件节点system.serviceModel增加一个名称为NewBehavior的节点:
<behaviors> <endpointBehaviors> <behavior name="NewBehavior"> <dataContractSerializer maxItemsInObjectGraph="65536000" /> </behavior> </endpointBehaviors> </behaviors>
同时在client节点的endpoint节点内怎加如下配置,跟上面内容关联。
behaviorConfiguration="NewBehavior",配置结果如下
<endpoint address="http://127.0.0.1:9371/ReseiverService.svc" behaviorConfiguration="NewBehavior" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IReseiverService" contract="IDCardService.IReseiverService" name="BasicHttpBinding_IReseiverService" />
- 读取XML数据时,已超过最大字符串内容长度配额(8192)。可以通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象上的MaxStringContentLength属
- 使用web服务时,超出最大字符串内容长度配额 (8192)。通过更改在创建 XML 读取器时所使用的 XmlDictionaryReaderQuotas 对象的 MaxStringContentLen
- 通过更改在创建 XML 读取器时所使用的 XmlDictionaryReaderQuotas 对象的 MaxArrayLength 属性,可增加此配额
- 读取 XML 数据时,超出最大字符串内容长度配额 (8192)。
- 读取 XML 数据时,超出最大字符串内容长度配额 (8192)
- wcf教程-传递数据过大怎么配置?读取 XML 数据时,超出最大字符串内容长度配额 (8192)
- InnerException 消息是“反序列化对象 属于类型 *** 时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。(注意细节)
- 【C#】解决进行反序列化时出错:。InnerException 消息是“反序列化对象 属于类型 System.String 时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。
- VS+SqlServe 在引用了webservice后刷新数据时提示:已超过传入消息(65536)的最大消息大小配额若要增加配额请使用相应绑定元素上 MaxReceivedMessageSize 属性
- WCF 上传大数据时 报错 读取 XML 数据时,超出最大数组长度配额(16384)
- SharePoint 读取Oracle webservice “已超过传入消息(65536)的最大消息大小配额。”
- 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。
- 引用webservice 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。
- 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性
- sharepoint 2013 webservice 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性
- 引用webservice 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。
- 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。
- WCF 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。
- Java中ReetrantLock与Synchronized对比
- BrocadcastReceiver广播 常规使用
- ORACLE 常用命令
- python3编码解码
- POJ(116,1718)-----The Castle(openjudge)
- 读取XML数据时,已超过最大字符串内容长度配额(8192)。可以通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象上的MaxStringContentLength属
- 最近在学习云服务器,一些学习笔记记录下来,留着以后查看
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration
- 介绍tomcat的目录结构
- 关于支付成功,实现页面跳转方案
- NodeJS
- php实现定时任务
- 高仿APP——元贝驾考(一)FragmentUtils
- NP 完全问题8.3