I have SOAP request looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gd="http://test.com/gds-mvmnt">
<env:Header/>
<env:Body>
<ns1:getContainer env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<code xsi:type="xsd:string">PCK26397841</code>
<messageId xsi:type="xsd:string"/>
</ns1:getContainer>
</env:Body>
</env:Envelope>
I need to create mock which select response based on code tag value. No need to modify responses. Responses added to mock as is. Just need logic like this: if code A then Response 1, if code B then Response 2 and so on. Please help me with basic groovy script.
That is possible by writing simple
Script Dispatch
.Here is the approach:
Here is the Script: