Hi,
Scenario is:
a) webservice(Suppose Webservice.asmx) is hosted on one server, suppose www.xyz.com
b) On www.xyz.com domain, a javascript file is present who accesses this webservice.
c) On www.test.com , the javascript file of www.xyz.com is included in html page.
d) When i run html page of www.test.com site, i got following error :
" 500 internal server error(Check in browser console)."
e) When i include same javascript file in html page of www.xyz.com 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;
$.ajax({
type: 'POST',
crossDomain: true,
dataType: "jsonp",
jsonpCallback: 'jsonCallback',
contentType: "application/json; charset=utf-8",
url: baseurl + "/HelloWorld",
data: '{}',
dataType: "json",
success: function(data) {
alert(data.d);
},
error: function(err) {
alert(err.statusText);
}
});
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.