Click here to Skip to main content
11,921,491 members (62,294 online)
Rate this:
Please Sign up or sign in to vote.
See more: JSONP
I am trying to pass data across different domain using jsonp.
Code to call my service
    type: "GET",
    url: window.serviceURL + "CheckWebsite",
    data: {
         domain: domainName, 
         website: sitename 
    dataType: "jsonp",
    contentType: "application/json; charset=utf-8",
    success: function (data) {},
   error: function (jqXHR, textStatus, errorThrown) {
        if (window.console) console.log("Error... " + textStatus + "        " + errorThrown);

First i hosted this service on IIS6 and passed data up to length of 3000 and it worked fine,now i moved my service to IIS7 .The service work properly on IIS7 even even but it does not allow me to pass 3000 characters at a time instead the url length is limited to 2000 now. Do i have to make any additional settings for IIS7

Below is my web.config
    <jsonSerialization maxJsonLength="5000" />
</scripting></system.web.extensions><connectionStrings><add name="connectionString" connectionString="Data Source=sql2\\yukon;Initial Catalog=TMS_20110623;User id=sa; password=sa;" /></connectionStrings><appSettings><add key="connectString" value="Data Source=sql4;Initial Catalog=vbr;User id=sa; password=sa;" /></appSettings><system.web><compilation debug="true" targetFramework="4.0" /><httpRuntime enable="true" maxQueryStringLength="50000" maxUrlLength="100000" maxRequestLength="100000" /></system.web><system.serviceModel><standardEndpoints><webScriptEndpoint><standardEndpoint name="" crossDomainScriptAccessEnabled="true" /></webScriptEndpoint><webHttpEndpoint<standardEndpoint name="" helpEnabled="True" automaticFormatSelectionEnabled="true" />
    <binding crossDomainScriptAccessEnabled="true">
  <service name="RestService.RestServiceImpl" behaviorConfiguration="ServiceBehaviour">
            <endpoint address="" binding="webHttpBinding" contract="RestService.IRestServiceImpl" behaviorConfiguration="web">
    <behavior name="ServiceBehaviour">
               <serviceDebug includeExceptionDetailInFaults="true" />
    <behavior name="web">
      <webHttp />
<modules runAllManagedModulesForAllRequests="true" />
            <add value="Test1.aspx" />
            <add name="Access-Control-Allow-Origin" value="*" />
Posted 10-Jan-13 2:32am
ryanb31 10-Jan-13 8:05am
I have seen this before but do not remember it. If you google the error that you get when you try to pass too much I think you'll find your answer pretty quick.
sneha kavinkar 10-Jan-13 8:28am
I get this error
Failed to load resource: the server responded with a status of 404 (Not Found)
and really didn't found anything helpful on google

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

you can increase the size of the query by incresing the maxJsonLength.
Please try adding following code to the web.config file. if you need any help please send a message
				<jsonserialization maxjsonlength="102400" />

you may like to read following article also[^]

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

  Print Answers RSS
0 OriginalGriff 553
1 Dave Kreskowiak 245
2 phil.o 160
3 KrunalRohit 134
4 Sergey Alexandrovich Kryukov 132
0 OriginalGriff 6,951
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,171
3 George Jonsson 2,840
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web03 | 2.8.151120.1 | Last Updated 10 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100