Forum Discussion
SmartBear_Suppo
Alumni
12 years agoHi,
Following this tip here: http://www.soapui.org/Scripting-Properties/tips-a-tricks.html#6-changing-response-before-it-gets-validated, you can use this script in a RequestFilter.afterRequest Event Handler to remove the ID's part of your response, as long as all the requests you expect it to apply to will have that same same response format.
Regards,
Giscard
SmartBear Support
Following this tip here: http://www.soapui.org/Scripting-Properties/tips-a-tricks.html#6-changing-response-before-it-gets-validated, you can use this script in a RequestFilter.afterRequest Event Handler to remove the ID's part of your response, as long as all the requests you expect it to apply to will have that same same response format.
if( request.response == null )
return
// get response content
def content = context.httpResponse.responseContent
//log.info content
def sub1 = content.substring(0, content.indexOf("<ns2:IDs>"))
//log.info "sub1: " + sub1
def sub2 = content.substring(content.indexOf("</ns2:IDs>")+10)
//log.info "sub2: " + sub2
content = sub1 + sub2
//log.info content
// write it back
context.httpResponse.responseContent = content
Regards,
Giscard
SmartBear Support