0

I have web service and I am calling it from jQuery, everything works fine until I remain on the same server, but when I try to call that service from other domain I don't get anything please somebody help me. Below is my code :

$.ajax({
type: 'POST',
url: 'http://-----------/Service.asmx/BulkUpdate',
data:"{'CaseID': '"+CaseID+"'}",
contentType : "application/json; charset=utf-8;",
"dataType" : "json",

success: function(xData, status) 
{
alert(xData.d);
}
,error : function(xhr)
{
alert(xhr.responseText);
 }
});
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
codery2k
  • 79
  • 3
  • 11

1 Answers1

0

Try using with JSONP, if its a cross domain issue. as below

"dataType":"JSONP"

OR

You can configure your server to allow request from your other domain. anything is fine i think.

Hope this solves your question.

  • Santosh I have tried "dataType":"JSONP" this, it didn't work, can you please tell me how can I configure my server to allow request from other domain. – codery2k May 21 '13 at 05:42
  • What error you got when you used JSOP, did you try to log the error. with JSONP it should work. else you have to do request header configuration in your web service project. @codery2k – Santosh Kurdekar May 21 '13 at 08:43