c# - Unexpected response returned by WCF Service: (413) Request Entity Too Large -
i've implemented small set of rest services using wcf. 1 of services recieves large amount of data. when calling (this when runnig visual studio - haven't deployed itto production server yet) error
the remote server returned error: (413) request entity large.
my web config
<binding name="basichttpbinding_isalesorderdataservice" closetimeout="00:10:00" opentimeout="00:10:00" receivetimeout="00:10:00" sendtimeout="00:10:00" allowcookies="false" bypassproxyonlocal="false" hostnamecomparisonmode="strongwildcard" maxbufferpoolsize="2147483647" maxbuffersize="2147483647" maxreceivedmessagesize="2147483647" textencoding="utf-8" transfermode="buffered" usedefaultwebproxy="true" messageencoding="text"> <readerquotas maxdepth="2000000" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="2147483647" maxnametablecharcount="2147483647" /> <security mode="none"> <transport clientcredentialtype="none" proxycredentialtype="none" realm="" /> <message clientcredentialtype="username" algorithmsuite="default" /> </security> </binding>
in addition increasing message size , buffer size quotes, consider increase maxitemsinobjectgraph serializer. can matter if object has complex structure or array of objects inside. our typical setting so
<behaviors> <endpointbehaviors> <behavior name="globalendpoint"> <datacontractserializer maxitemsinobjectgraph="1365536" /> </behavior> </behaviors> <servicebehaviors> <behavior name="globalbehavior"> <datacontractserializer maxitemsinobjectgraph="1365536" /> </behavior> </servicebehaviors>
and additionaly zwan has proposed
Comments
Post a Comment