WCF 服务已超出最大数组长度配额 (16384) [英] WCF service The maximum array length quota (16384) has been exceeded

查看:63
本文介绍了WCF 服务已超出最大数组长度配额 (16384)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 wsf 服务和一个客户端应用程序.在尝试与客户端和服务通信时,我收到以下消息:

I have a wsf service and a client application. While trying to communicate the client and the service I've gotten the following message:

"格式化程序在尝试反序列化消息时抛出异常:尝试反序列化参数时出错 http://tempuri.org/:blob.InnerException 消息是反序列化 FileBlob 类型的对象时出错.读取 XML 数据时已超出最大数组长度配额 (16384).此配额可能通过更改创建 XML 读取器时使用的 XmlDictionaryReaderQuotas 对象的 MaxArrayLength 属性来增加.第 1 行,位置 25931.'.有关详细信息,请参阅 InnerException."

"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:blob. The InnerException message was 'There was an error deserializing the object of type FileBlob. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 25931.'. Please see InnerException for more details."

我有 customBinding 元素,但它不允许我插入readerQuotas"部分.在客户端和服务配置中,我都有以下绑定元素:

I have the customBinding element and it doesn't allow me to insert "readerQuotas" section. In both the client and service configs I have the following binding element:

<customBinding>
  <binding name="LicenseServiceBinding"
                closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
      <security authenticationMode="UserNameOverTransport">
          <localClientSettings maxClockSkew="00:07:00" />
          <localServiceSettings maxClockSkew="00:07:00" />
      </security>
      <windowsStreamSecurity />
      <httpsTransport maxReceivedMessageSize="2147483646"/>          
  </binding>
</customBinding>

在此先感谢您的帮助:)

Thanks in advance for any help:)

推荐答案

实际上,我已经通过在 textMessageEncoding 部分中添加 readerQuotas 解决了这个问题.感谢您的帮助.

Actually, I've solved the problem by adding readerQuotas within textMessageEncoding section. Thanks for the help.

<textMessageEncoding messageVersion="Soap11">
          <readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="2147483646" maxBytesPerRead="4096" maxNameTableCharCount="5242880"/>
</textMessageEncoding>

这篇关于WCF 服务已超出最大数组长度配额 (16384)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆