Request entity too large Error(413)

I have an project that use a wcf on the server to save a file in the database. I am sending Json to the wcf.
this wcf work fine for small json file but when it come to a larger one it gives an error (My Json file is 150Kb ) :
 "Remote server returned an unexpected response :Error (413) Request entity is too large error".
I tried every solution found on the internet :
        <binding maxReceivedMessageSize="2147483647" 
          <readerQuotas maxDepth="32"

Open in new window

and I tried configuring the iss UploadReadAheadSize  but it didn't work .
Any Idea how to solve this issue?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Rainer JeschorCommented:
have you configured both the "client" side as well as the server (WCF service) side?
Is your WCF Service RESTful?
ProgrammerAtAIMSAuthor Commented:
Yes I have configured both side and my wcf service is RESTful.
Anil GolamariCommented:
You need to modify the configurations on both Service and Client as well. Are both have same configuration like maxbuffersize?

If you're still getting this error message while using the WCF Test Client, it's because the client has a separate MaxBufferSize setting. If not you can try below steps:

Right-Click on the Config File node and at the bottom of the tree
Select Edit with SvcConfigEditor
A list of editable settings will appear, including MaxBufferSize.

Note: Auto-generated proxy clients also set MaxBufferSize to 65536 by default.
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.

ProgrammerAtAIMSAuthor Commented:
Hi Anil Golamari i configured both service and client and maxbuffersize is set to "2147483647" in both .
in the edit with svcconfigeditor i have same properties that i already added in my webconfig code and set to the max.
Still not working.
Thank for your advice .
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
I'm recently facing this similar issue. the weird thing is that after I have done the configuration, I can use FileUpload control to upload large file, but not the Restful web service.

Is anyone found a solution here?
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
I resolved my own similar issue by doing the following settings:

1) Adding something similar below in web.config:
          maxBufferSize="2147483647" transferMode="Streamed">

Open in new window

2147483647 is equals to 2GB, hence we need to change it to proper size for Production site.

2) in IIS, update the settings of:

> Go to the site, file the Configuration Editor under “Management”
> Go to Sections in
    > system.webServer/security/authentication/anonymousAuthentication
    > system.webServer/security/authentication/windowsAuthentication
> Select ApplicationHost.config <location=’<site name>’ />
> Unlock the Section

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
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

From novice to tech pro — start learning today.