I have a result that returns from an API that looks like so:
[CODE]
<serv:header><serv:response>
<serv:result>SUCCESS</serv:result><serv:gsbStatus>PRIMARY</serv:gsbStatus>
</serv:response></serv:header>
There is more before and after the example I have given but the ones I want are the result and the gsbStatus.
Example of a failed call:
[CODE]
<serv:header><serv:response><serv:result>FAILURE</serv:result><serv:reason>WebExID or Email is already in use by this site.</serv:reason><serv:gsbStatus>PRIMARY</serv:gsbStatus><serv:exceptionID>030004</serv:exceptionID></serv:response>
So I am trying to yank a couple of values out of here. First, the result. If it’s SUCCESS that’s all I need to retrieve. If it’s FAILURE I also need to grab the reason.
Was wondering if anyone would have a good way to do this.