I have a custom WCF service that external services are using to send generated documents through for storage in SharePoint.
Small files are working fine, but anything over 64KB is getting rejected with: (413) Request Entity too large.
Since I have used a factory in my svc, I have configured a feature and then in the Installed event for the feature I have put the following code:
SPWebService contentService = SPWebService.ContentService;
contentService.ClientRequestServiceSettings.MaxReceivedMessageSize = -1;
SPWcfServiceSettings settings = new SPWcfServiceSettings();
if (contentService.WcfServiceSettings.ContainsKey("dmsservice.svc"))
{
settings = contentService.WcfServiceSettings["dmsservice.svc"];
}
settings.MaxReceivedMessageSize = Int32.MaxValue;
settings.MaxBufferSize = Int32.MaxValue;
settings.ReaderQuotasMaxStringContentLength = Int32.MaxValue;
settings.ReaderQuotasMaxArrayLength = Int32.MaxValue;
settings.ReaderQuotasMaxBytesPerRead = Int32.MaxValue;
contentService.WcfServiceSettings["dmsservice.svc"] = settings;
contentService.Update(true);
However, even though all the posts i have found indicate that the above should work, it is not. So what am I missing in order to get this service to accept bigger files?