Forum Discussion

Pabe1975's avatar
Pabe1975
Occasional Contributor
6 years ago

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 ...
  • Pabe1975's avatar
    Pabe1975
    5 years ago

    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 = toText

    The 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