I'm attempting a request data from a HTTP POST asmx web service with jQuery's ajax. I've read numerous guides on how to do this correctly but with no success. From what I can determine, it is the request itself that is failing:
$.ajax({
type: 'POST',
url: "http://data.niassembly.gov.uk/organisations.asmx/GetPartiesListCurrent_JSON",
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({}),
dataType: 'json',
success: function(data){
if (data.hasOwnProperty('d')){
msg = data.d;
} else {
msg = data;
}
alert(msg);
}
,
error:function(){
alert('error');
}
});
The JSON formatting is correct and when I save the content as a local .json file the function works. The service also has a GET option but from what I've read that won't work in this case.