Click here to Skip to main content
13,048,027 members (109,390 online)
Rate this:
Please Sign up or sign in to vote.

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
Updated 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 10 Apr 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