search cancel

Service created through recorded transaction with API don't work. The normal parameters are not created.

book

Article ID: 216601

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

 

Description:

The creation of a virtual service through recorded transaction yields different results when done using the Portal UI and when using the Virtual Service Invoke API v2.

 

When creating a service through recording using the Portal UI, URLPARAMS and URI rules are correctly recognized and set.
In screenshot 1.png and 2.png, a service was created through recording the “Cars Example Service” and it worked correctly.

In fact, the virtual service can answer to /inventory/carInventory/{URLPARAM0} requests, even for cars that have not been recorded.

Image 1:

 

 

Image 2:

If instead the same service is created through recording using the Virtual Service Invoke API v2
(as described here: https://techdocs.broadcom.com/us/en/ca-enterprise-software/devops/devtest-solutions/10-5/using/using-the-apis/virtual-service-invoke-api.html )
then no {URLPARAM} is found in the vsi (3.png) and no URI Rule is set in the vsm (in the Data protocol filters, inside the HTTP/S listener node) (4.png).

image 3:

Image 4:

 

As a result, the virtual service can only respond to the exact requests that were recorded:

/inventory/carInventory/2T1KR32E37C639014

/inventory/carInventory/1ZVBP8AM1D5256900

/inventory/carInventory/3N1CB51D351458771

If instead a different car is queried, the virtual service cannot match the request (5.png)

image 5:

The same problem appears even when adding new transactions to an existing virtual service through recording, by setting its Execution Mode in "Learning Mode"

 

 

 

Environment

Release : 10.6

Component : CA Service Virtualization

Cause

 

In the documentation, there is an optional step to add a Data Protocol that if executed will cause an issue

Resolution

 
 
 

The client was doing an optional step to add a data protocol which caused the Automatic creation of the URL Parameters to not be created.

DevTest only will review transactions on the first pass and add URL if no Data Protocol is added.
This sends the application through an analysis phase that will do a parameter substiation.

If you add a Data Protocol or you add a transaction this process is not done.

Attachments