In the below code i am using a console application with WCF service to upload files. It used to upload the file correctly with no errors. Now it is throwing error "The remote server returned an unexpected response: (413) Request Entity Too Large". This error displays when the file is more than 1MB. Please s anyone help me to solve the issue.
Client App.config
<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_MemberService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /> <binding name="BasicHttpBinding_DocumentManagement" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" receiveTimeout="00:20:00" sendTimeout="00:20:00" > <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> <binding name="BasicHttpBinding_ContentService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" messageEncoding="Mtom" /> <binding name="BasicHttpBinding_Collaboration" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /> <binding name="BasicHttpBinding_Authentication" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /> <binding name="BasicHttpBinding_SearchService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /> </basicHttpBinding> </bindings> <client> <endpoint address="...." binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_MemberService" contract="MemberWS.MemberService" name="BasicHttpBinding_MemberService"/> <endpoint address="....." binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_DocumentManagement" contract="DocumentManagementWS.DocumentManagement" name="BasicHttpBinding_DocumentManagement" /> <endpoint address="...." binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ContentService" contract="ContentWS.ContentService" name="BasicHttpBinding_ContentService" /> <endpoint address="...." binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Collaboration" contract="CollaborationWS.Collaboration" name="BasicHttpBinding_Collaboration" /> <endpoint address="...." binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Authentication" contract="AuthenticationWS.Authentication" name="BasicHttpBinding_Authentication" /> <endpoint address="...." binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_SearchService" contract="SearchWS.SearchService" name="BasicHttpBinding_SearchService" /> </client> </system.serviceModel> </configuration> Old web.config file on IIS Server <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.web> <httpRuntime maxRequestLength="2147483647" executionTimeout="14400" /> </system.web> <system.webServer> <staticContent> <mimeMap fileExtension=".properties" mimeType="application/octet-stream" /> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" /> </staticContent> <security> <requestFiltering> <requestLimits maxAllowedContentLength="2200000000" /> </requestFiltering> </security> </system.webServer> </configuration>
No comments:
Post a Comment