Save the Exchange

The exchange (request and response) between the calling application and MockMotor can be saved for later retrieval. This is one of the very rarely used functions.

This may be necessary when a value in the request is required for continuing the flow but is not directly available to the flow script.

For example, a middleware can generate a unique ID for an email confirmation URL and send it out; the flow script needs to “click” on the URL to continue with the flow but it doesn’t know the ID. However, the middleware internally calls another system with that ID, and that another system is mocked. MockMotor can then save the exchange including the ID and the flow script can retrieve it and continue the execution:

Here is what happens in the example above:

1 A request comes in
2 MockMotor processes the request as usual, generating a response
3 Then MockMotor calculates the “computed key” value as $input//*:Data. Say the value is 123456.
4 The request and response are saved
5 Now the script can do HTTP GET at http://server/console/api/retrieve?respid=<GUID>&key=123456
6 The GET response will contain both the request and response