tags:

views:

266

answers:

1

Is there a size limit to the amount of data you can send to a WCF service? I send an array of objects over and when the array gets to be a certain size, I get a 404 bad request exception.

Is this a limit of httpHosting? Would another type of hosting work better?

+1  A: 

There is a maximum array size and maximum content size. Here is the XML (put in your App.config) to increase the size.

specify net tcp binding config:

    <bindings>
        <netTcpBinding>
          <binding name="TCPSession"  
closeTimeout="01:01:00"
            openTimeout="01:01:00" receiveTimeout="01:10:00" sendTimeout="01:01:00"
            transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
            hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647"
            maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647"
        </netTcpBinding>
      </bindings>
Russell
You can also use ReaderQuotas (in the netTcpBinding): <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />This will also work for basicHttpBinding
Russell