Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

WCF and Maximum array length Quota
TduToit
#1 Posted : Thursday, June 30, 2011 12:19:22 AM(UTC)


Was thanked: 2 time(s) in 2 post(s)
I created a blob field for uploading large files. The file data is then converted into a byte array and sent to the WCF service.

Received the following error:
Quote:
"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"


Resolved it by adding binding configurations in my Client/Server app.configs:

Code:
<system.serviceModel>
    <bindings>
      <netTcpBinding>
          <binding name="UserServiceServiceBindingConfiguration" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
            hostNameComparisonMode="StrongWildcard" listenBacklog="10"
            maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10"
            maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="32"
                        maxStringContentLength="2147483647"
                        maxArrayLength="2147483647"
                        maxBytesPerRead="2147483647"
                        maxNameTableCharCount="2147483647" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
          <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint name="IUserService"
                address="net.tcp://localhost:8002/UserService"
                bindingConfiguration="UserServiceServiceBindingConfiguration"
                binding="netTcpBinding"
                contract="AIS.Batch.Services.IUserService"/>
    </client>
  </system.serviceModel>
1 user thanked TduToit for this useful post.
xomega on 6/30/2011(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.