c# - Web Service error : HTTP 413: Request Entity Too Large -
my system:
iis 7.5
visual studio 2010
framework 4
i have make web service receive file(byte array). have make console app consume it(add service reference-->advance-->add web reference). http working perfectly. need consume https. so, when try consume https, giving me http 413: request entity large. have been reading lot, impossible. have tried put in webconfig of web service:
<system.servicemodel> <bindings> <basichttpbinding> <binding name="basichttpbinding_inopservice" maxreceivedmessagesize="22147483647" maxbufferpoolsize="252428800" maxbuffersize="22147483647"> <readerquotas maxdepth="256" maxstringcontentlength="22147483647" maxarraylength="2222216384" maxbytesperread="2222220000" maxnametablecharcount="2222216384" ></readerquotas> </binding> </basichttpbinding> <basichttpbinding> <binding name="httpbigmessage" receivetimeout="00:10:00" sendtimeout="00:10:00" maxreceivedmessagesize="2147483647" > <security mode="none" /> </binding> </basichttpbinding> </bindings> <client> <endpoint address="https://localhost/hmenu/getdata.asmx" binding="basichttpbinding" bindingconfiguration="basichttpbinding_inopservice" contract="photosavingsservice.inopservice" name="basichttpbinding_inopservice" /> </client> </system.servicemodel>
the file not large. need put max size?
thank
many times adding line
<httpruntime maxrequestlength="214748364" executiontimeout="9999" targetframework="4.5"/>
gives 500 error
please find out allready exists in web configuration file hi guys 500 error occurs if there wrong configuration in web.config fix first. here providing 413 entity large on https protocol issue fix
web.config before issue fixed
<bindings> <webhttpbinding> <binding name="restservicebindingconfig"> <security mode="transport"></security> </binding> <binding name="httprestservicebindingconfig"> <security mode="none"></security> </binding> <binding maxbufferpoolsize="76000000" maxreceivedmessagesize="19000000"> <readerquotas maxdepth="32" maxstringcontentlength="19000000" maxbytesperread="2147483647" maxnametablecharcount="2147483647"/> </binding> </webhttpbinding> </bindings> <behaviors>
we copy pasted readerquotas maxbufferpoolsize maxreceivedmessagesize in transport mode restservicebindingconfig made trick first restservicebindingconfig https second httprestservicebindingconfig binding http
web.config after issue fixed
<bindings> <webhttpbinding> <binding name="restservicebindingconfig" maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647"> <readerquotas maxdepth="32" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="4096" maxnametablecharcount="16384" /> <security mode="transport"></security> </binding> <binding name="httprestservicebindingconfig" maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647"> <readerquotas maxdepth="32" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="4096" maxnametablecharcount="16384" /> <security mode="none"></security> </binding> </webhttpbinding> </bindings> <behaviors>
Comments
Post a Comment