Consume XML - message undefined



I'm trying to consume XML Web Service but I'm getting result.Message undefined in success function. Whats wrong in this code? The error is:



Uncaught TypeError: Cannot read property 'Message' of undefined


Here is my code:



function RequestService() {
$.ajax({
type: "GET",
url: "http://ift.tt/1C2MsY9",
data: "",
dataType: "xml",
success: function(data) { SucessCallback(data.d); },
error: function(data) { FailureCallBack(data); }
});
}

function SucessCallback(result) {
$('p').html('Resultado: ' + result.Message + ' <br /> Descrição: ' + result.Description);
}

function FailureCallBack(result) {
alert("erro");
}

No comments:

Post a Comment