How to create a Virtual Service Model that needs to reach to 2 different live systems.

book

Article ID: 14575

calendar_today

Updated On:

Products

CA Application Test Service Virtualization CA Continuous Application Insight (PathFinder) CA Service Virtualization (DevTest / LISA / VSE / Application Test)

Issue/Introduction



How to configure a Virtual Service Model (VSM) to reach to 2 different live systems in the same model.

Environment

All supported DevTest versions.

Resolution

You could do it in different ways.

1. Create 2 different VSMs and VSIs and configure the live invocation step to reach different live systems. 

Each VSM can listen on the same port and have different base path. 

VSM1 - /AB1/base/path/abc/ 

VSM2 - /CD1/base/path/abc/ 

The VSI operations names would be different – following the base path above.

 

2. Customize your VSM to use 2 live invocation steps and the 'Compare Strings for Next Step Lookup' step.

In this case, if you have 2 VSIs, we first need to combine the two service images into one - Combine Service Images.

We also need to make sure the virtual service models DPH are updated to handle the incoming requests to the combined VSI. The unique VSM needs to have the proper DPHs under Virtual HTTPS Listener/ Filters.

The virtual service image in the example below was created against the DemoServer.

Service Image:

<Please see attached file for image>

src="/servlet/servlet.FileDownload?file=0150c000004AKkYAAW" alt="CompareStringsForNextStepLookupSI.PNG" width="1303" height="281">

 

In the VSM, add the step 'Compare Strings for Next Step Lookup' after the  'VS Image Response Selection'  step and add two 'Live Invocation' steps.

<Please see attached file for image>

src="/servlet/servlet.FileDownload?file=0150c000004AKkWAAW" alt="CompareStringsForNextStepLookup.PNG" width="1378" height="414">

Add new entries to the 'Compare Strings for Next Step Lookup' step: 

<Please see attached file for image>

src="/servlet/servlet.FileDownload?file=0150c000004AKkXAAW" alt="CompareStringsForNextStepLookupAddNewEntry2.PNG" width="1041" height="524">

1.In the 'Text to match:' field I provided the response of the 'Virtual HTTPS Listener' - {{lisa.Virtual HTTPS Listener.rsp}}. The step that receives the incoming request.

2.The 'Criteria' and 'Compare Type' fields are the ones that will do the comparison. 

3.The 'Next Step' field will be the step that will be executed when the match is found.

In the example above the step will first look for the string 'GET /itko-examples/user-manage.jsp/' in the 'lisa.Virtual HTTPS Listener.rsp' property. When this string is found, the request is forwarded to 'Virtual HTTPS Live Invocation 2' step. If the 'GET /itko-examples/' string is found, the request is forwarded to the 'Virtual HTTPS Live Invocation 1' step.

4.If no match is found the next step will be the ‘Virtual HTTPS Responder' step.

In the live invocation steps, set the 'Virtual HTTPS Responder' as the next step.

Additional Information

More details regarding 'Compare Strings for Next Step Lookup' step can be found in the product documentation: Compare Strings for Next Step Lookup Step.

Attachments

1558709623865000014575_sktwi1f5rjvs16rjf.png get_app
1558709621971000014575_sktwi1f5rjvs16rje.png get_app
1558709619946000014575_sktwi1f5rjvs16rjd.png get_app