I am new in SoapUI, and was trying to understand the use of XPATH dispatch for a mock operation in a mock service.
Here is what I have done so far
- Created a mock service for a calculator
- Added mock operation substract
Following is a sample request for the operation
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://www.parasoft.com/wsdl/calculator/">
<soapenv:Header/>
<soapenv:Body>
<cal:subtract>
<cal:x>1</cal:x>
<cal:y>1</cal:y>
</cal:subtract>
</soapenv:Body>
</soapenv:Envelope>
Following is a sample response for the same
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://www.parasoft.com/wsdl/calculator/">
<soapenv:Header/>
<soapenv:Body>
<cal:subtractResponse>
<cal:Result>?</cal:Result>
</cal:subtractResponse>
</soapenv:Body>
</soapenv:Envelope>
I was able to understand about other dispatch but not about XPATH as following is what I have entered in the XPATH dispatch
declare namespace cal='http://www.parasoft.com/wsdl/calculator/';
declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
//cal:subtract/cal:x
It was also observed that if I have already used SCRIPT dispatch and switch to XPATH from the dropdown, the script is visible in the declaration/scripting box/area
Following are the questions:
- Is XPATH and SCRIPT dispatch same
- If not, how does the XPATH dispatch actually work to identify what response to dispatch out of all form MockResponses list
Kindly help me with this.
PS: I have already gone through http://www.soapui.org/soap-mocking/reference/mockoperation.html http://www.soapui.org/soap-mocking/mockoperations-and-responses.html