I know the "HTTP 413 Request Entity too large" error is a FAQ. But I have a variation that I've been unable to figure out for two days now. I've created a WCF service endpoint as part of an on-prem SharePoint 2013 application (see below). The web site is SSL enabled and I'm getting the 413 error. I've tried increasing maxReceivedMessageSize
in the site web.config per the many posts related to this error as well as modifying the flag on the site itself via IIS Manager / Site / Management / Configuration Editor. But nothing seems to work. I can post small files with no problem. My guess is that maybe SharePoint does something to override the binding and that I need to apply the maxReceivedMessageSize
change in a different place
Service contract
[ServiceContract]
public interface ISharepointService
{
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "UploadFile?partner={partnerid}&location={locationid}&filename={filename}&type={type}&period={period}")]
void UploadFile(string partnerid, string locationid, string filename, string type, string period, Stream stream);*
web.config
<services>
<service behaviorConfiguration="serviceBehavior" name="MyCompany.Sharepoint.MyService.SharepointServiceApp">
<endpoint address="Sharepoint" behaviorConfiguration="webBehavior" binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyCompany.Sharepoint.MyService.SharepointServiceApp"></endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="webBinding" maxReceivedMessageSize="2147483647">
<security mode="Transport">
</security>
</binding>
</webHttpBinding>
</bindings>