title: HTTP 413 error posting to SharePoint web service
body: <p>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 <code>maxReceivedMessageSize</code> 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 <code>maxReceivedMessageSize</code> change in a different place</p>
  
  <p><strong>Service contract</strong></p>
  
  <pre><code>[ServiceContract]
  public interface ISharepointService
  {
  
      [OperationContract]   
      [WebInvoke(Method = "POST", UriTemplate = "UploadFile?partner={partnerid}&amp;location={locationid}&amp;filename={filename}&amp;type={type}&amp;period={period}")]   
      void UploadFile(string partnerid, string locationid, string filename, string type, string period, Stream stream);*
  </code></pre>
  
  <p><strong>web.config</strong> </p>
  
  <pre><code>&lt;services&gt;
    &lt;service behaviorConfiguration="serviceBehavior" name="MyCompany.Sharepoint.MyService.SharepointServiceApp"&gt;
      &lt;endpoint address="Sharepoint" behaviorConfiguration="webBehavior" binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyCompany.Sharepoint.MyService.SharepointServiceApp"&gt;&lt;/endpoint&gt;
      &lt;endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;bindings&gt;
    &lt;webHttpBinding&gt;
      &lt;binding name="webBinding" maxReceivedMessageSize="2147483647"&gt;
        &lt;security mode="Transport"&gt;
        &lt;/security&gt;        
      &lt;/binding&gt;
    &lt;/webHttpBinding&gt;
  &lt;/bindings&gt;
  </code></pre>