Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I had developed WCF service to interact SQL Server database from android application.For normal interaction it was working fine but when i try to post large data it was throwing 414 error.Here is my code:

XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
         <httpRuntime maxQueryStringLength="2097151" maxUrlLength="2097151" />
    </system.web>
<connectionStrings>
    <add name="DBConnection" connectionString="Integrated Security=true;Data Source=LENOVO\SQLEXPRESS;Initial Catalog=SCHOOLDB" providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.serviceModel>
      <services>
      <service name="FusilMobileServices.MobileServices" behaviorConfiguration="ServiceBehaviour">
        <endpoint address="" binding="webHttpBinding" contract="FusilMobileServices.IMobileServices" behaviorConfiguration="web">
        <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
      </service>
    </services>

      <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviour">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="web">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>

  </system.serviceModel>

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

 <system.webServer>
   <security>
     <requestFiltering>
       <requestLimits maxAllowedContentLength="2147483647" maxUrl="2097151" maxQueryString="2097151" />
     </requestFiltering>
   </security>
  </system.webServer>
</configuration>
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900