读取 XML 数据时,超出最大字符串内容长度配额 (8192)。

本文探讨了在使用WCF服务时遇到的反序列化异常问题,特别是当XML数据长度超过默认限制导致的问题,并提供了通过调整XmlDictionaryReaderQuotas对象的MaxStringContentLength属性来增加配额的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

未处理 System.ServiceModel.Dispatcher.NetDispatcherFaultException
  Message=格式化程序尝试对消息反序列化时引发异常: 尝试对参数 http://tempuri.org/ 进行反序列化时出错: GetTasksResponse。InnerException 消息是“反序列化对象 属于类型 mofang_926.MoFangWSC.GetTasksResponseBody 时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。通过更改在创建 XML 读取器时所使用的 XmlDictionaryReaderQuotas 对象的 MaxStringContentLength 属性,可增加此配额。 行 1,位置 22681。”。有关详细信息,请参见 InnerException。











http://www.suchso.com/projecteactual/wcf-jiaocheng-big-data.html

<bindings>
      <netTcpBinding>
        <binding name="TcpBindingConfig" maxBufferPoolSize="655360000000"  maxBufferSize="655360000"     maxReceivedMessageSize="655360000000" transferMode="Streamed">
          <readerQuotas maxDepth="32" maxStringContentLength="655360000"
 maxArrayLength="655360000"
 maxBytesPerRead="655360000" maxNameTableCharCount="655360000" />
          <security mode="None" />
        </binding>
      </netTcpBinding>
      <basicHttpBinding>
          <binding name="BasicHttpBindingConfig" maxBufferPoolSize="655360000000" maxBufferSize="655360000"  maxReceivedMessageSize="655360000000" sendTimeout="00:02:00" transferMode="Streamed">
            <readerQuotas maxDepth="32" maxStringContentLength="655360000"
 maxArrayLength="655360000"
 maxBytesPerRead="655360000" maxNameTableCharCount="655360000" />
          <security mode="None"/>
        </binding>
      </basicHttpBinding>
    </bindings>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值