zanhtet
zanhtet

Reputation: 2050

webservice and asp

I created a asp page. Also I created a asp.net web service. And I caught this webservice response using javascript in asp page. But I got that.

<?xml version="1.0" encoding="utf-8"?>

<string xmlns="http://localhost/DevTrack4U">**True**</string>

I want to get the value that is True. But I got like this. How can I retrieve this.

Upvotes: 0

Views: 194

Answers (1)

Jordan
Jordan

Reputation: 32522

The easiest way is to use jQuery:

$.ajax({
    type: "GET",
    url: "http://MyPathToWebServiceGoesHere/",
    dataType: "xml",
    success: function(xml) {
        var myString = $(xml).find('string').text();
}
});

This code will work if there is only one "string" element. FWIW, I suggest using a more descriptive name than "string".

Upvotes: 2

Related Questions