0

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.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.