IIS7 - (413) Request Entity Too Large | uploadReadAheadSize

I am new to WCF I am writing a WCF Service that has a Data Contract that has a Byte array as a property. WHen I convert a small file it works but when I use a larger image say 1 meg or up I get

The remote server returned an unexpected response: (413) Request Entity Too Large. I need help please

here is my server side web.config


<?xml version="1.0"?>
<configuration>

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <system.serviceModel>
    <!--<bindings />-->
    <bindings>
      <basicHttpBinding>
        <binding name="LargeSettings" maxReceivedMessageSize="2147483647">
          <!--maxBufferSize="524288"
                 maxBufferPoolSize="524288"-->
          <!--<readerQuotas maxDepth="32" maxStringContentLength="100000"
                        maxArrayLength="16384" maxBytesPerRead="4096"
                        maxNameTableCharCount="16384"
                        />-->
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name ="WCFService_VB1.StudentData"
               behaviorConfiguration ="ServiceWithMetadata">
        <endpoint name="Default"
                  address="http://www.ortho-sync.com:8080/StudentData.svc"
                  binding="basicHttpBinding"
                  bindingConfiguration="LargeSettings"
                  contract ="WCFService_VB1.IStudentData"/>
        <!--<endpoint
          address="mex"
          binding="mexHttpBinding"
          contract="WCFService_VB1.IStudentData"/>-->

      </service>
    </services>

    <client />
    <behaviors>
      <serviceBehaviors>
        <behavior name ="ServiceWithMetadata">
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <!-- 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 -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />

        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
        <add binding="basicHttpBinding" scheme="http" />
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>






my client side code is

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IStudentData" maxReceivedMessageSize="2147483647" />
                <binding name="BasicHttpBinding_IHeartbeat" maxReceivedMessageSize="2147483647" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://www.ortho-sync.com:81/StudentData.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IStudentData"
                contract="oStudentData.IStudentData" name="BasicHttpBinding_IStudentData" />
            <endpoint address="http://www.ortho-sync.com:81/StudentData.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IHeartbeat"
                contract="oStudentData.IHeartbeat" name="BasicHttpBinding_IHeartbeat" />
        </client>
    </system.serviceModel>
</configuration>
hainansyndromeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hainansyndromeAuthor Commented:
I have tried changing my bindings to this and still fails


<bindings>
      <basicHttpBinding>
        <binding name="LargeSettings"
                maxBufferPoolSize="2147483647"
      maxReceivedMessageSize="2147483647"
      maxBufferSize="2147483647" transferMode="Streamed">

          <readerQuotas maxDepth="32" maxStringContentLength="100000"
                        maxArrayLength="16384" maxBytesPerRead="4096"
                        maxNameTableCharCount="16384" />
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>
0
apeterCommented:
Please try with below readerQuotas

<readerQuotas maxDepth="2147483647"
             maxStringContentLength="2147483647"
             maxArrayLength="2147483647"
             maxBytesPerRead="2147483647"
             maxNameTableCharCount="2147483647" />
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Amandeep Singh BhullarCommented:
Hi,

Please check the below URL, if this can be of any help to you
http://forums.iis.net/t/1169257.aspx
0
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

hainansyndromeAuthor Commented:
apeter i still get
The remote server returned an unexpected response: (413) Request Entity Too Large.
0
apeterCommented:
Your server contract is this "WCFService_VB1.IStudentData"

and client contract is "oStudentData.IStudentData" and "oStudentData.IHeartbeat".

Two queries
1. Why server contract and client contract missmatching ?
2.  Why this address, "http://www.ortho-sync.com:81/StudentData.svc" has two contracts in it ?
0
hainansyndromeAuthor Commented:
oStudentData.IHeartbeat is a 1 way Messaging contract.
I am new to WCF so I am really figuring this out as I go
0
apeterCommented:
Can you please fix my query 1 and checked ?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.