WCF - 最大阵列长度配额(16384)

时间:2015-01-28 14:29:50

标签: wcf exception wcf-binding

当我收到文件时,我收到此例外。

我的客户端配置:

 <bindings>
     <basicHttpBinding>

      <binding name="basicHttpSecuredBinding"
               maxReceivedMessageSize = "2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" sendTimeout="00:25:00" receiveTimeout="00:25:00">

          <readerQuotas maxDepth="2147483647" 
                maxStringContentLength="2147483647"
                maxArrayLength="2147483647" 
                maxBytesPerRead="2147483647"
                maxNameTableCharCount="2147483647" />

          <security mode="TransportWithMessageCredential">
              <message clientCredentialType="Certificate"/>
          </security>
      </binding>

</basicHttpBinding>

客户端端点

<client>
      <!--TODO: currently configured to work with the staging for testing-->
      <endpoint name="ep_SmtkSyncService"
               address="https://1234.com/SyncService.svc"
               binding="basicHttpBinding"
               bindingConfiguration="basicHttpSecuredBinding"
               behaviorConfiguration="transportWithClientCredentialsBehavior" 
               contract="SynerionHcm.Smtk.Domain.Common.Contracts.ISmtkSyncService" />

    </client>

这个例外让我发疯:

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.'.  Please see InnerException for more details. ---> System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type 

0 个答案:

没有答案