您的位置:首页 > 移动开发 > Objective-C

前不久出现的WCF一个错误 —— MaxStringContentLength & MaxReceivedMessageSize

2009-01-16 00:13 585 查看
具体错误信息如下:

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."

 

 

WCF配置节:

<bindings>
<netTcpBinding>
<binding name="NewBinding0" maxReceivedMessageSize="6553600">
<readerQuotas maxStringContentLength="6553600" />
</binding>
</netTcpBinding>
</bindings>
 
如果没有设置<readerQuotas maxStringContentLength="6553600" />,则默认值为readerQuotas的默认最大长度为8192. 因此当长度超过8192时,会抛出文章开头提到的错误。

同样需要另外设定binding的maxReceivedMessageSize,否则会抛出System.ServiceModel.CommunicationException异常。

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  wcf binding xml object 360 string
相关文章推荐