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

[英]WCF: The maximum string content length quota (8192) has been exceeded while reading XML data


Having scoured the internet and StackOverflow, I have yet to come across a solution that works. When attempting to read a response I'm getting, the inner exception is:

在浏览了互联网和StackOverflow之后,我还没有找到一个有效的解决方案。当我试图读取我得到的响应时,内部异常是:

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.

读取XML数据时已超出最大字符串内容长度配额(8192)。通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象的MaxStringContentLength属性,可以增加此配额。

I am a client contacting a server and I am receiving a response back that, after looking at the response, is much larger than the 8192 limit. I have updated my client config to the max level but it hasn't helped. I'm out of ideas as to where to update the limit so any help would be appreciated:

我是一个联系服务器的客户端,我收到的回复是,在查看响应后,远远大于8192限制。我已将我的客户端配置更新到最高级别,但它没有帮助。我不知道在哪里更新限制,所以任何帮助将不胜感激:

Client Config:

<configuration>
  <system.serviceModel>
    <client>
      <endpoint name="CaqhCore_EndpointWithCertificates" address="https://MyEndPoint" behaviorConfiguration="Cbc_BehaviorWithCertificateSigning" binding="customBinding" bindingConfiguration="Cbc_BindingWithCertificates" contract="CORETransactions">
        <identity>
          <certificateReference findValue="1h 1h 1h 1h 1h 1h 1h 1h 1h 1h" x509FindType="FindByThumbprint" />
        </identity>
      </endpoint>
    </client>
    <bindings>
      <customBinding>
        <binding name="Cbc_BindingWithCertificates" maxReceivedMessageSize="2147483647">
          <security enableUnsecuredResponse="false" allowSerializedSigningTokenOnReply="true" authenticationMode="MutualCertificate" requireDerivedKeys="false" includeTimestamp="true" messageProtectionOrder="SignBeforeEncrypt" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
            <issuedTokenParameters keyType="AsymmetricKey" />
            <secureConversationBootstrap>
              <issuedTokenParameters keyType="AsymmetricKey" />
            </secureConversationBootstrap>
          </security>
          <textMessageEncoding messageVersion="Soap12WSAddressingAugust2004" writeEncoding="utf-8">
            <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          </textMessageEncoding>
          <httpsTransport />
        </binding>
      </customBinding>
    </bindings>
  </system.serviceModel>
</configuration>

Please note, I have removed information from the config that I don't feel is pertinent due to privacy issues but please let me know if you need to see other pieces like the behaviours or other elements.

请注意,我已从配置中删除了由于隐私问题而我认为不相关的信息,但如果您需要查看其他部分(如行为或其他元素),请告诉我。

1 个解决方案

#1


0  

I've found the answer. The issue was that the code I was working with (not written by me) had the code containing the object: XmlDictionaryReaderQuotas commented out, which meant it was not able to read the readerQuotas node from the config file and therefore was using default values.

我找到了答案。问题是我正在使用的代码(不是由我编写)的代码包含对象:XmlDictionaryReaderQuotas已注释掉,这意味着它无法从配置文件中读取readerQuotas节点,因此使用了默认值。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2015/03/26/13e99c6a815c2537829161dc63a9588b.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告