Forum Discussion
SmartBear_Suppo
Alumni
14 years agoHi,
hmm... you could add a RegquestFilter.afterRequest event handler (in the Project windows' Events tab) that changes the response to be something more readable by soapUI - preferably an XML version of your Java Objects (which would allow you to assert, etc..). For example the following replaces any png with a short XML string:
if( request.response == null )
return
if( context.httpResponse.contentType == "image/png" )
{
// get response content
def content = context.httpResponse.responseContent
// manipulate content here...
log.info content
// write it back
context.httpResponse.responseContent = "<xml><text>this is a png!</text></xml>"
}
A similar script could be created to convert the serialized java object..
Hope this helps!
/Ole
SmartBear Software
hmm... you could add a RegquestFilter.afterRequest event handler (in the Project windows' Events tab) that changes the response to be something more readable by soapUI - preferably an XML version of your Java Objects (which would allow you to assert, etc..). For example the following replaces any png with a short XML string:
if( request.response == null )
return
if( context.httpResponse.contentType == "image/png" )
{
// get response content
def content = context.httpResponse.responseContent
// manipulate content here...
log.info content
// write it back
context.httpResponse.responseContent = "<xml><text>this is a png!</text></xml>"
}
A similar script could be created to convert the serialized java object..
Hope this helps!
/Ole
SmartBear Software