title: WCF Service Error 413 "Entity Too Large" when pass big byte[]
body: <p>I got this error when trying to pass large byte[] to wcf service 
  my IService Code:</p>
  
  <pre><code>[OperationContract]
          [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json, UriTemplate = "SaveFile")]
          SaveFileResult SaveFile(byte[] FileBytes, string FileName, decimal Filesize, string IntegrationSystem, string TellerIndentity, string SendingOfficeCode, string SendingArea);
  </code></pre>
  
  <p>Service Code:</p>
  
  <pre><code>public SaveFileResult SaveFile(byte[] FileBytes, string FileName, decimal Filesize, string IntegrationSystem, string TellerIndentity, string SendingOfficeCode, string SendingArea)
          {
              FileFactory _FileFactory = new FileFactory();
              string _strExt = Path.GetExtension(FileName);
              IFileDealer _IFileDealer = _FileFactory.GetFileDealer(_strExt);
              SaveFileResult _Result=_IFileDealer.SaveFile(FileBytes, FileName, Filesize, IntegrationSystem, TellerIndentity, SendingOfficeCode, SendingArea);
              return _Result;
          }
  </code></pre>
  
  <p>wcf service Config:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;connectionStrings&gt;
      &lt;add name="CenterPostEntities" connectionString="metadata=res://*/DatabaseDesign.GRemModel.csdl|res://*/DatabaseDesign.GRemModel.ssdl|res://*/DatabaseDesign.GRemModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=TEST-SH\SQL2005;initial catalog=CenterPost;user id=sa;password=itsc;MultipleActiveResultSets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt;
    &lt;/connectionStrings&gt;
    &lt;appSettings&gt;
      &lt;add key="PermittedFastUploadSize"  value="1000000"/&gt;
      &lt;add  key ="GRemLog" value="d:\GRemLog"/&gt;
      &lt;add key="FileUploadPath" value="d:\FileUpload"/&gt;
    &lt;/appSettings&gt;
      &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0" /&gt;
        &lt;httpRuntime maxRequestLength="2097151" /&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;!--======================--&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="basicHttpBindingSettings"  openTimeout="00:01:00" receiveTimeout="05:00:00" sendTimeout="05:00:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647777" messageEncoding="Text"&gt;
            &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="2147483647" /&gt;
            &lt;!-- To avoid disclosing metadata information,
          set the value below to false and remove the metadata endpoint above before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="True"/&gt;
            &lt;!-- To receive exception details in faults for debugging purposes,
          set the value below to true.  Set to false before deployment
          to avoid disclosing exception information --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;!--======================--&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
    &lt;/system.serviceModel&gt;
   &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
     &lt;serverRuntime enabled="true" uploadReadAheadSize="2147483647"  /&gt;
    &lt;/system.webServer&gt;
  </code></pre>
  
  <p>Please any one help me to solve this problem 
  i increased uploadReadAheadSize on iis7 but still not working
  i want to know why this code not working </p>