web config - JSON Limited to 1180 Characters -


i have simple javascript json request stringify's object send via json request c# web server.

whenever string returned stringy on 1180 characters, webmethod not called on server.

from understanding, there no limit on how string data client can send via json. understand limitation on server end, trying accept paramaterized request.

is there somewhere in web.config can increase limit of 1180?

my current config;

<?xml version="1.0"?> <configuration>   <connectionstrings>     <add name="applicationservices" connectionstring="data source=.\sqlexpress;integrated security=sspi;initial catalog=aspnetdb" providername="system.data.sqlclient"/>     <add name="applicationservices2" connectionstring="data source=.\sqlexpress;integrated security=sspi;initial catalog=trimweb" providername="system.data.sqlclient"/>     <add name="applicationservices3" connectionstring="data source=.\sqlexpress;integrated security=sspi;initial catalog=customers" providername="system.data.sqlclient"/>     <add name="applicationservices4" connectionstring="data source=.\sqlexpress;integrated security=sspi;initial catalog=orderupdate;user id=test1;password=test1;" providername="system.data.sqlclient"/>   </connectionstrings>     <system.servicemodel>       <servicehostingenvironment multiplesitebindingsenabled="true" />        <behaviors>         <endpointbehaviors>           <behavior name="webhttpbehavior">             <webhttp />           </behavior>         </endpointbehaviors>       </behaviors>       <bindings>         <webhttpbinding>           <binding name="webhttpbindingwithjsonp" crossdomainscriptaccessenabled="true" />         </webhttpbinding>        </bindings>       <services>         <service name="servicesite.customersservice">           <endpoint address="" binding="webhttpbinding"                     bindingconfiguration="webhttpbindingwithjsonp" contract="servicesite.customersservice"                     behaviorconfiguration="webhttpbehavior"/>         </service>       </services>     </system.servicemodel>      <system.web>         <compilation debug="true" targetframework="4.0" />     </system.web>     <system.webserver>       <modules runallmanagedmodulesforallrequests="true"/>     </system.webserver>  </configuration> 

youll need change webhttpbinding below:

   <webhttpbinding>       <binding name="webhttpbindingwithjsonp" crossdomainscriptaccessenabled="true" maxreceivedmessagesize="20000000" maxbuffersize="20000000" maxbufferpoolsize="20000000"/>       <readerquotas maxdepth="32" maxarraylength="200000000" maxstringcontentlength="200000000"/>    </webhttpbinding> 

see docs <webhttpbinding> here

note: increasing value alone not sufficient in asp.net compatible mode. should increase value of httpruntime (see httpruntime).

this should like:

<httpruntime     maxquerystringlength = "2048"    maxrequestlength="4096"    maxurllength = "260"    requestlengthdiskthreshold="80"/> 

(increase amounts needed)


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -