Service Virtualization

sampleProject.zip 

Jun 27, 2014 02:19 PM

This is a sample project that shows how to create a virtual service that can be manipulated from an external properties file to change the flow of the VSM.  The three different modes are as follows:

 

  1. Pass thru - this mode passes a request thru to a live service and only access the VSI in the event that certain errors are detected in the response from the live service.
  2. Capture - this mode passes the request to the live service and store the xml request/response of the call in an external properties folder called XMLPairs (found in the External Properties folder of the attached zip).
  3. Virtual - this mode is your basic VSM path.  It simply takes xml request and sends them straight to the VSI and choosing the most appropriate response.

 

The VSM is driven by two values found in a file called properties.txt. An example of this file is found in the External Properties folder of the attached zip. This file needs to be external to your VSE and your VSE needs to have access to the path where the file is located.  That is because in the second step of the VSM, that file is accessed to get the values for the parameters of Mode and endpoint.  From there the VSM will follow assertions to determine the path through the VSE.  The proper Mode values are passthru, capture, virtual.  The endpoint value tells the Live Service call (when using passthru or capture) what the endpoint of your live service is.  This gives you the ability to change the endpoint to any other service endpoint without needing to redeploy the VSM, simply change the endpoint in the properties.txt file.  The endpoint value is parameterized in the 'endpoint' field of the Live Service step as {{endpoint}}.

 

I hope this helps.


Statistics
0 Favorited
3 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
zip file
sampleProject.zip   14 KB   1 version
Uploaded - May 29, 2019

Related Entries and Links

No Related Resource entered.