Forum Discussion
You can just use Xpath for dispatch. The result of the Xpath query is the name of the MockResponse that SoapUI will use. So if the MockResponse is exactly the same as the id you want to test for then, then just hit the declare button and then:
//*:id
A dispatch script works the same way, just have it return the name of the MockResponse you want to give:
import groovy.util.XmlSlurper import groovy.util.slurpersupport.GPathResult GPathResult Envelope = new XmlSlurper().parseText(mockRequest.requestContent) return Envelope.Body.Id
Which you can write as a one-liner if you want:
new groovy.util.XmlSlurper().parseText(mockRequest.requestContent).Body.Id
jamescollett
8 years agoContributor
Thank you, JHunt, for your contribution, but I am afraid I do not understand a word of it. I do not know where to start.
You are clearly a much more advanced user, starting from a level I have yet to reach.