1

目前我们连接到 WCF 服务。目前我收到间歇性的 CommunicationExceptions。

-> 异常 (CommunicationException) System.ServiceModel.CommunicationException:服务器返回了无效的 SOAP 故障。有关更多详细信息,请参阅 InnerException。---> System.Xml.XmlException: 读取 XML 数据时已超出最大字符串内容长度配额 (8192)。可以通过更改创建 XML 阅读器时使用的 XmlDictionaryReaderQuotas 对象的 MaxStringContentLength 属性来增加此配额。

我已经更新了我的配置文件,将 MaxStringContentLength 设置为 2147483647

仍然间歇性地收到这些错误。

关于可能导致它们的任何建议?

提前致谢, 菲奥娜

更新 以下是配置文件中的绑定:

<binding name="BasicHttpBinding_ServiceInterface" closeTimeout="00:01:00"
           openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
           allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
           maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
           messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
           useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
             maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="Message">
            <message clientCredentialType="Certificate"/>
          </security>
        </binding>
4

1 回答 1

0

您还需要设置Binding.MaxArrayLength,ReaderQuotas.MaxBytesPerRead以使其正常运行。

于 2012-06-28T06:35:14.630 回答