I have a Silverlight application that uploads files in chunks to a WCF service. When I run both the service and the Silverlight app locally everything works fine. When I deploy them both to IIS it will work for files that are smaller than the chunk size (16k in this case) but if the file is larger than that it fails. It is almost exactly like the problem described here: http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/19329afc-8a73-4756-80cd-bbdada75c0e2 but the solution there doesn’t work for me, I already keep a strong reference to the WCF proxy instance. But in my case as in that one, a single asynch call will succeed but multiple calls will fail.
Here’s the serviceModel entry from the web.config:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="binaryHttpBinding" closeTimeout="00:20:00" openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00">
<binaryMessageEncoding maxReadPoolSize="2147483647" maxWritePoolSize="2147483647" maxSessionSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
</binaryMessageEncoding>
<httpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" authenticationScheme="Anonymous" maxBufferSize="2147483647" transferMode="Buffered"/>
</binding>
</customBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service name="ADE.Web.IADEFileTransferService" >
<endpoint address="" binding="customBinding" bindingConfiguration="binaryHttpBinding"
contract="ADE.Web.ADEFileTransferService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
You need to have the same readerQuotas settings on both client and server side i.e. your silverlight config file needs to have the same settings as well.
Also consider adding the dataContractSerializer element in the serviceBehaviour tab with maxItemsInObjectGraph as shown below
Also you can try to add the maxRequestLength value of httpRunTime element as shown below: