I have a requirement where in I have a to send getUser request to backend with a token. The response from backend is json data. Once the response reaches, I need to read the json response to check if it is success or failure due to token expiry. In case of token exppiry, I need to make another call to backend to first get the new User token(again backend returns json response) and then make the getUser call with new token.
If I use, set routing-url, I could allow the response to hit my response rule and able to convert the json to xml. But is it good practise to check the response in the response rule and call get Token call and getUser call from response rule ?
I think, I need to use url-open to make getUser call. I did that and decoded to get the json string. Noiw how do I convert the json string into jsonX and then XML ? How do I pass the value of this json string into another action, that could convert the json into jsonX ?
Can someone please help