Response message automatically encoded to base64
Hi All;
I wonder if someone came across this issue and has a way to solve it. I am getting an valid SOAP response from the service and that does not have a CDATA section in it. When receiving it in ReadyApi (2.60) the response is automatically encoded to base64. This does not happen for other services I am using and when debugging the message in NJams I get a normal response from the service.
Of course I have looked into the base64 encoding option that is in the settings of ReadyApi and the compression limit setting is empty. I have tried putting in a large value so the message falls within the limit set in the option (so it is not encoded).
Hopefully someone can give me a hand.
Thanks in advance !
Paul
This is the correct solution:
Add the RequestFilter.afterRequest event handler with this string to decode the response -
def encodedResp = context.httpResponse.responseContent
def decodedResp = encodedResp.decodeBase64()
String toText = new String (decodedResp)
context.httpResponse.responseContent = toTextThe script will be executed on receiving each response, and you will see the decoded response content in the XML, Outline and Overview tabs.
In this article, you will find more details about handling events - https://support.smartbear.com/readyapi/docs/testing/handling-events.html