Click here to Skip to main content
12,951,983 members (64,706 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
I am trying to pass data across different domain using jsonp.
Code to call my service
$.ajax({
    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
<configuration><system.web.extensions>
<scripting>
  <webServices>
    <jsonSerialization maxJsonLength="5000" />
  </webServices>
</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" />
  </webHttpEndpoint>
</standardEndpoints>
<bindings>
  <webHttpBinding>
    <binding crossDomainScriptAccessEnabled="true">
    </binding>
  </webHttpBinding>
</bindings>
<services>
  <service name="RestService.RestServiceImpl" behaviorConfiguration="ServiceBehaviour">
            <endpoint address="" binding="webHttpBinding" contract="RestService.IRestServiceImpl" behaviorConfiguration="web">
             </endpoint>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehaviour">
               <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="web">
      <webHttp />
    </behavior>
  </endpointBehaviors>
</behaviors>
 </system.serviceModel><system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
    <defaultDocument>
        <files>
            <add value="Test1.aspx" />
        </files>
    </defaultDocument>
    <httpProtocol>
        <customHeaders>
            <add name="Access-Control-Allow-Origin" value="*" />
        </customHeaders>
    </httpProtocol></system.webServer></configuration>
Posted 10-Jan-13 1:32am
Dexter111.2K
Comments
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
 
good
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
<configuration>
	<system.web.extensions>
		<scripting>
			<webservices>
				<jsonserialization maxjsonlength="102400" />
			</webservices>
		</scripting>
	</system.web.extensions>
</configuration>


you may like to read following article also
http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=9709891[^]
  Permalink  
v2

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,239
CHill60 3,490
Maciej Los 3,083
Jochen Arndt 1,975
ppolymorphe 1,880


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 10 Jan 2013
Copyright © CodeProject, 1999-2017
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