In my app using JavaScript i am calling a web-service and getting the following response
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body><ns:createNewUserResponse xmlns:ns="http://ITAHTA.org.com">
<ns:return>2341</ns:return>
</ns:createNewUserResponse>
</soapenv:Body>
</soapenv:Envelope>
Now i want to parse this response , i want to get the value in the ns:return tag and store it in a variable in javascript.
I tried a below
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
alert(xhr.responseText.getElementsByTagName("return"));
}
}
But i am not getting any value. Please let me know the correct way to parse it.