I have one Cross Domain WCF. I have already implemented the CORS on the service.
If the method don't have any parameter, then I can call it using JQuery Ajax.
But the problem is, when the method is having any parameter then some error is occurred after the JQuery Ajax call.
$.support.cors = true;
$.ajax({
url: servicePath,
crossDomain: true,
type: 'POST',
async: false,
cache: false,
data: '{"name": "xyz"}',
contentType: "application/json; charset=utf-8",
dataType: 'json',
processData: true,
success: function (response) {
alert('s');
},
error: function (error) {
alert(error.status + ' : ' + error.statusText);
}
})