Forum Discussion

sharmameera's avatar
sharmameera
Contributor
9 years ago

Trying to use RequestFilter.filterRequest event to convert CDATA SOAP Response to XML. Not working

I have a SOAP request which returns the complete response in CDATA. I am trying to convert it to XML using the RequestFilter.filterRequest event handler. But it is not working. The response is still coming back as CDATA. I am using the following help document (which is no help at all obviously)...

 

http://readyapi.smartbear.com/readyapi/events/handlers

 

My code:

def content = context.httpResponse.responseContent
content = content.replaceAll("<![CDATA[<QuoteObject>", "")
content = content.replaceAll( "]]>", "")

log.info( content )

context.httpResponse.responseContent = content

 

Please help.

  • nmrao's avatar
    nmrao
    Champion Level 3
    RequestFilter itself conveys that it is applied for request not for response.
      • nmrao's avatar
        nmrao
        Champion Level 3
        Well, you are applying wrong one.
        Why do not you show the raw response? And what you want out of it?