Calling Rest Service and getting XML Data


$(function () {
$.ajax({
type: "GET",
dataType: "xml",
url: "http://localhost/MyService/EmployeeRESTService.svc/GetEmployeeList/",
success: function (data) {
xmlParser(data);
},
error: function (error) {
alert(error);
}
});
});

function xmlParser(data) {
$(data).find('Employee').each(function () {
var FirstName = $(this).find('FirstName').text();
var LastName = $(this).find('LastName').text();
var Email = $(this).find('Email').text();
var State = $(this).find('State').text();

alert("Data: " + FirstName + " - " + LastName + " - " + Email + " - " + State);

});
}

Testing the Rest Service!!!!!

About Kishore Dhanekula

MS Dynamics CRM and .NET Architect
This entry was posted in Ms Dynamics CRM 2013, MS Dynamics CRM 2015. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s