If you want to pass large binary files via a WCF channel, you need to increase the maxStringContentLength on your WCF host app.config/web.config file. From my sample on my IssueTracker project, I added a new bindings element to the system.serviceModel section as below:
<bindings>
<wsHttpBinding>
<binding name=”WSHttpBinding_IDataService” closeTimeout=”00:01:00″
openTimeout=”00:01:00″ receiveTimeout=”00:10:00″ sendTimeout=”00:01:00″
bypassProxyOnLocal=”false” transactionFlow=”false” hostNameComparisonMode=”StrongWildcard”
maxBufferPoolSize=”2147483647″ maxReceivedMessageSize=”2147483647″
messageEncoding=”Text” textEncoding=”utf-8″ useDefaultWebProxy=”true”
allowCookies=”false”>
<readerQuotas maxDepth=”2147483647″ maxStringContentLength=”2147483647″ maxArrayLength=”2147483647″
maxBytesPerRead=”2147483647″ maxNameTableCharCount=”2147483647″ />
<reliableSession ordered=”true” inactivityTimeout=”00:10:00″
enabled=”false” />
<security mode=”Message”>
<transport clientCredentialType=”Windows” proxyCredentialType=”None”
realm=”” />
<message clientCredentialType=”Windows” negotiateServiceCredential=”true”
algorithmSuite=”Default” establishSecurityContext=”true” />
</security>
</binding>
</wsHttpBinding>
</bindings>
Having done that, your service will still not using this binding configuration, you need to add the binding name to the bindingConfiguration attribute inside your service element.
<services>
<service behaviorConfiguration=”DataServiceBehavior” name=”Zuko.Service.DataService”>
<endpoint address=”” binding=”wsHttpBinding” contract=”Zuko.Service.IDataService” bindingConfiguration=”WSHttpBinding_IDataService”>
<identity>
<dns value=”localhost” />
</identity>
</endpoint>
<endpoint address=”mex” binding=”mexHttpBinding” contract=”IMetadataExchange” />
</service>
</services>