问题描述
当我将实体对象传递给WebService时出现以下错误
读取XML数据时已超出最大字符串内容长度配额(8192)。通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象的MaxStringContentLength属性可以增加此配额
我尝试通过在Webservice的webconfig中提供以下代码来解决此问题,但错误仍然存在。任何人都可以帮助!!!!!
< bindings>
< basichttpbinding>
< binding>
name =myBinding
maxReceivedMessageSize =2147483647>
< readerquotas>
maxDepth =2147483647
maxStringContentLength =2147483647
maxArrayLength =2147483647
maxBytesPerRead = 2147483647
maxNameTableCharCount =2147483647/>
Hi,
I got the following error when i passed an entity object to a WebService
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
I tried to solve this problem by giving the below code in webconfig of Webservice,but the error still remains. Can anyone Help!!!!!
<bindings>
<basichttpbinding>
<binding>
name="myBinding"
maxReceivedMessageSize="2147483647">
<readerquotas>
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
推荐答案
<bindings>
<nettcpbinding>
<binding name="ExStreamWCFBinding" closetimeout="00:00:05" opentimeout="00:00:05" receivetimeout="00:00:05" sendtimeout="00:00:05" transfermode="Buffered" transactionprotocol="OleTransactions" hostnamecomparison="StrongWildCard" maxbufferpoolsize="524288" maxbuffersize="524288" maxconnections="10" maxreceivedmessagesize="5242880">
<readerquotas maxdepth="32" maxstringcontentlength="5242880" maxarraylength="16384" maxbytesperread="4096" maxnametablecharcount="16384" />
</binding>
</nettcpbinding>
</bindings>
<endpoint address="" binding="netTcpBinding" bindingconfiguration="ExStreamWCFBinding">
</endpoint>
有关详细信息,请参阅这些链接。
[]
[]
这篇关于读取XML数据时已超出最大字符串内容长度配额(8192)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!