Link to home
Start Free TrialLog in
Avatar of ProgrammerAtAIMS
ProgrammerAtAIMS

asked on

Request entity too large Error(413)

I have an asp.net 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 :
<bindings>
      <basicHttpBinding>
        <binding maxReceivedMessageSize="2147483647" 
                 maxBufferSize="2147483647"
                 maxBufferPoolSize="2147483647">
          <readerQuotas maxDepth="32"
                        maxArrayLength="2147483647"
                        maxStringContentLength="2147483647"/>
        </binding>
      </basicHttpBinding>
    </bindings>

Open in new window


and I tried configuring the iss UploadReadAheadSize  but it didn't work .
Any Idea how to solve this issue?
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Hi,
have you configured both the "client" side as well as the server (WCF service) side?
Is your WCF Service RESTful?
HTH
Rainer
Avatar of ProgrammerAtAIMS
ProgrammerAtAIMS

ASKER

Hi,
Yes I have configured both side and my wcf service is RESTful.
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.
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 .
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?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial