How to get the response error message while calling a webservice
Summary:
I am hitting a third-party webservice from Oracle CX Sales. Whenever the third-party sends us the error message in the response body I have to read the response body and display the error message in CX Sales.
try {
def httpHeaders = ['Content-Type':'application/json','x-functions-key':keyValue];
def wsService = adf.webServices.XXXXX;
wsService.requestHTTPHeaders = httpHeaders;
def PUT_param = []
def wsResponse = wsService.PUT(PUT_param);
}
catch (Exception e)
{
println (e)
}
In the above code, e displays 400 Bad request/ 500 Internal server error. But I need to display the error response body the third party sends.
Please provide any solution for this.
Drop in to one of our regularly scheduled CX demo hour sessions to learn more about Marketing & Sales Unification and more!
Learn more