There might be instances, where you have few variations of a response that needs to be sent based on a logic. You could do this by adding a dispatch script including your logic like below.
1.Go to required service's process interface and change DISPATCH option to 'script'.
In this example I will be dispatching a specific response based on an element of the incoming request.
Following is the sample script .
// create XmlHolder for request content
def holder = new com.eviware.soapui.support.XmlHolder( mockRequest.requestContent )
def arg1 = holder["//category"]
//if above element is empty
if( !com.eviware.soapui.support.StringUtils.hasContent( arg1 ))
return "Invalid Input Response"
if(arg1 == "Books" )
else if(arg1 == "Articles")
So here what we are returning would be the relevant mock response's name.