I can not get the value from an http response body.
I've used JSON.parse()
on the response.body I get as well as xml-js
library. The value I have to get is 'P01
'.
This is the response:
{
"Soap:Envelope":{
"_attributes":{
"xmlns:Soap":"http://schemas.xmlsoap.org/soap/envelope/"
},
"Soap:Body":{
"ValidateUser_Result":{
"_attributes":{
"xmlns":"urn:microsoft-dynamics-schemas/codeunit/UserValidation"
},
"return_value":{
"_text":"P01"
}
}
}
}
}
and here is what I've tried:
console.log(JSON.parse(data["Soap:Envelope"]["Soap:Body"]["ValidateUser_Result"]["return_value"])));