Issue with creating Virtual service using V3 API with modified basepath.

book

Article ID: 208949

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

Description:

When creating a Virtual Service from a swagger with the "Service Virtualization API v3", it is impossible to specify a basepath different from "/".

 

DevTest version:

10.6.0.1011

 

Example API Call:

POST /lisa-virtualize-invoke/api/v3/vses/VSE/services HTTP/1.1

Host: localhost:1505

Accept: application/json

[…]

Content-Disposition: form-data; name="config"

{

  "virtualService": {

    "version": "1",

    "name": "exampleService",

    "description": "",

    "status": ""

  },

  "transportProtocol": {

    "typeId": "HTTP",

    "basePath": "/example",

    "recordingEndpoint":{ 

        "useSSL":false,

        "host": "localhost",

        "port": "12345"

     }

  },

  "dataProtocol": {

    "forRequest": true,

    "typeId": "RESTDPH"

  }

}

 

Content-Disposition: form-data; name="deploy"

true


Content-Disposition: form-data; name="inputFile1"; filename="exampleSwagger.json"

Content-Type: application/json

(data)

 

Expected result:

Response:

{

"_links": {

[…]

"serviceName": "exampleService",

[…]

"resourceName": "12345 : http :  : /example",

}

The virtual service "virtualService" deployed in "VSE" listens on http://localhost/example:12345

 

Actual result:

Response:

{

"_links": {

[…]

"serviceName": "exampleService",

[…]

"resourceName": "12345 : http :  : /",

}

The virtual service "virtualService" deployed in "VSE" listens on http://localhost:12345

 

Additional data:

It looks like the service is deployed on a basepath given by the first character of the value of transportProtocol.basePath in "config".

E.g. if transportProtocol.basePath is set to "example", the service is deployed like this:

{

[…]

"serviceName": "exampleService",

[…]

"resourceName": "12345 : http :  : e",

}

 

 

Cause

Modified basepath was not handled by the V3 API call code. 

Environment

Release : 10.6

Component : CA Service Virtualization

Resolution

The patch patch_DE492547_10.6.0_GA should be requested from support by raising a support case.

Step to apply.

- Stop the VSE component.

- Place the patch under LISA_HOME/lib/patches/ folder. Create the patches folder if not present already.

- Start the VSE component.