Hello community I have a service WCF
that is published on a server X, I need to consume a method of that service through AJAX
, the service method receives as parameter an object with two properties, the way in which I'm consuming the service is this:
var para = { parameters: { Propiedad1: 'xxx', Propiedad2: 'xxx' } };
data = JSON.stringify(para);
$.ajax({
type: "POST",
url: "http://RutaServicio/Service.svc/MetodoServicio",
data: data,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert('ok');
},
error: function (xhr) {
console.log(data);
console.log(xhr.responseText);
}
});
But when consuming the service, it enters through the error and message is undefined
, How can I consume the service correctly?