What the base path is in a Virtual Service Model
search cancel

What the base path is in a Virtual Service Model

book

Article ID: 117800

calendar_today

Updated On:

Products

CA Application Test CA Continuous Application Insight (PathFinder) Service Virtualization

Issue/Introduction


What is the base path in the Virtual Service Model?

Environment

All supported DevTest releases.

Cause

N/A

Resolution

Think of the base path as the base URL (or root) that your consumer application appends its endpoint path to. For example, consider that you have 4 REST calls:

POST /myco/services/createProfile

GET /myco/services/getProfile

GET /myco/services/searchProfile

POST /myco/services_v1/createWidget

Each of the above generates an operation in the VSI . But, notice that the 4th operation is slightly different from the first 3. When you deploy a service, the VSM uses the base path to help it form a tie-breaker to determine if the incoming request can be sent to the virtual service.  Suppose all the services are deployed on port 8001.

A base path of: /myco/services/ allows only the first 3 requests into the VSM.

A base path of: /myco/ allows all 4 requests into the VSM

A base path of: /myco/services_v1/ only allows the 4th request.

So, the base path works as LearnNow indicates. We tighten or loosen the base path according to what the VSI can provide answers for.

 

Let's look at a negative example. Suppose you build the above operations into 4 VSMs. Each VSM represents a 1 to 1 service. And, suppose you deploy all 4 services to the same port (8001). In this example, createProfile is in 1 service, getProfile is in another and so on.

 

But, in the VSM for each service you specify "/myco/" as the base path.

 

What happens in this scenario?

 

This "/myco/" base path is too loose. An incoming request is passed to all 4 services because the base path of "/myco/" is satisfied. DevTest doesn't know which service is supposed to receive the request -- it just knows they all can accept and process the request. In this scenario, the first service that responds is the response that the consumer receives -- which might not be the correct one (e.g., a service image not found response).

 

 Base path is extremely important to understand, and even more important to understand when more than one service is listening on the same port.