Click here to Skip to main content
11,811,971 members (57,210 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET Javascript Ajax jQuery , +

Scenario is:
a) webservice(Suppose Webservice.asmx) is hosted on one server, suppose
b) On domain, a javascript file is present who accesses this webservice.
c) On , the javascript file of is included in html page.
d) When i run html page of site, i got following error :
" 500 internal server error(Check in browser console)."
e) When i include same javascript file in html page of domain then it works fine.
f) Both applications are running on IIS6.0

I am using this code for cross domain web service call :

$.support.cors = true;
        type: 'POST',
        crossDomain: true,
        dataType: "jsonp",
        jsonpCallback: 'jsonCallback',
        contentType: "application/json; charset=utf-8",
        url: baseurl + "/HelloWorld",
        data: '{}',
        dataType: "json",
        success: function(data) {
        error: function(err) {
I added this header entry in IIS6.0 : Access-Control-Allow-Origin" value="*"

When I run it, i get 500 internal server error(Check in browser console).

Can anyone please let me know how to solve cross domain webservice access issue.

Thanks in Advance.
Posted 9-Apr-13 4:05am
Edited 10-Apr-13 5:50am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I have faced that issue, I wanted to access a certain page on certain site but I got that similar error. It turns out that you cannot do a ajax call of link other other site. Browser does not allow.

I solved it by calling a page in the same server and from that page I made an HTTP connection with that HTTP page and echo the returned result as output. It served my purpose
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Check virtual directory for both services in IIS

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

  Print Answers RSS
0 KrunalRohit 354
1 Palash Mondal_ 185
2 CHill60 180
3 OriginalGriff 178
4 Abhinav S 175
0 OriginalGriff 3,888
1 KrunalRohit 2,392
2 CPallini 2,240
3 Maciej Los 2,155
4 ppolymorphe 1,725

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 10 Apr 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