nastester
2 years agoRegular Contributor
Event handler to trim CDATA from JMS response
I am looking for a way to remove CDATA from the XML response of my JMS Requests.
Thinking the best way to do this would be with an event handler but open to other suggestions.
I have this as a RequestFilter.afterRequest:
def content = context.httpResponse.responseContent
content = content.replaceAll( "<data contentType='null' contentLength='33173'><![CDATA[", "")
content = content.replaceAll( "]]></data>", "" )
context.httpResponse.responseContent = content
I think part of the problem is the JMS Request response isn't an 'httpResponse' but I'm not sure how to identify the content in this context.
For some context, I am publishing a message via the MQTT test step and capturing the response message off a queue manager via JMS.