为什么WCF格式化程序会抛出异常?

时间:2009-04-30 02:56:40

标签: wcf web-services

在调用WCF服务时收到以下错误消息:

  

“格式化程序在尝试反序列化消息时抛出异常:尝试反序列化参数http://tempuri.org/:fieldText时出错.InstallException消息是'反序列化System.String []类型的对象时出错。读取XML数据时已超出最大字符串内容长度配额(8192)。可以通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象的MaxStringContentLength属性来增加此配额。第1行,位置10889.'。请参阅InnerException了解更多详情。“

我的web.config中的WCF部分如下所示:

<basicHttpBinding>
        <binding name="BasicHttpBinding_IMySvc" maxReceivedMessageSize="2147483647" sendTimeout="00:05:00"
                 messageEncoding="Text" textEncoding="utf-8" >
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="163840000"/>
        </binding>
</basicHttpBinding>

此外,输入消息的大小为:15869个字符。

我在这里缺少什么?

1 个答案:

答案 0 :(得分:3)

确保您的端点实际上正在使用绑定。

<endpoint address="" binding="basicHttpBinding" contract="IMySvc" bindingConfiguration="BasicHttpBinding_IMySvc">
相关问题