Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF REST POST operation throwing 413 (Entity Too Large) error

Tags:

rest

iis

wcf

I've created, using the built-in project template, a WCF REST-based service. Everything works just great except that when I attempt to "POST" a file (as a stream) to one of my operations, I'm consistently getting a 413 (Entity Too Large) response.

I've looked at all the other 413 questions related to WCF and they're all related to non-REST services and/or IIS6 configurations and mention either the <system.Web> or <binding>properties.

Any ideas?

like image 848
DreamTimeStudioZ Avatar asked Jan 11 '12 21:01

DreamTimeStudioZ


2 Answers

Well... I figured it out!

It turns out that the setting which worked is one which has to be applied to the standardEndpoint node inside system.serviceModel node:

<system.serviceModel>
    <standardEndpoints>
        <webHttpEndpoint>
            <standardEndpoint name=""
                 helpEnabled="true"
                 automaticFormatSelectionEnabled="true"
                 maxReceivedMessageSize="2147000000"
                 />
        </webHttpEndpoint>
    </standardEndpoints>
</system.serviceModel>
like image 122
DreamTimeStudioZ Avatar answered Oct 16 '22 16:10

DreamTimeStudioZ


Check the quotas and max's in your config file maxmessagesize, etc. defaults are 8192, 16384, 65536

like image 36
Steven Licht Avatar answered Oct 16 '22 17:10

Steven Licht