Service Virtualization

 View Only
  • 1.  Externally feed HTTP rest request / response to virtual service (VSI)

    Posted Jun 10, 2016 04:40 PM

    Hi All,

    I am looking for an option to feed http request response pair data externally to the virtual service. I will go on creating request response pair files on the VSE host and virtual service will automatically pickup the files, identify the request response pair files and create transactions in VSI.

    Any other best solution ? Please suggest.

    Thanks.



  • 2.  Re: Externally feed HTTP rest request / response to virtual service (VSI)

    Posted Jun 10, 2016 04:53 PM

    Hi ,  What is the reason you need to do this way .. just want to know if the below solution helps you or adds complexity ..

     

    you have an option create a virtual service from raw_traffic file and also you can build VS using command line utilities where u don't have to login to devtest ws..

     

    for this you need to do some sort of pre-work..

     

    1. prepare raw_traffic.. there is particular format which lisa can understand and build virtual service so you need to make sure your req and res follow that format.. i know manually it is though to build raw_traffic the way lisa wants but you can have some automated scripts (ruby, groovy) which can extract your request and build raw_traffic..

     

    2. write small command line script .cmd or .sh ,,, where it will accept raw_traffic and build VS and deploy VS to wherever you want..

     

    I know the above option is not so easy but this is the way have been done for one of the use case where req and res will be shared on the wire as part of continuos deployment and testing..

     

    you can explore rest api for detest if anything for this.. i have not used those much apart from stop , start use etc.,



  • 3.  Re: Externally feed HTTP rest request / response to virtual service (VSI)

    Posted Jun 10, 2016 05:29 PM

    Thanks for the references. I will look into these solutions. The purpose of this requirement is to avoid reimplementation and redeployment of virtual service. I want to decouple data management  from virtual service. Virtual service will be running all the time without depending on matching transactions in VSI. Virtual service should be smart to pick req-res pair files automatically and update VSI with transaction entries. Similar to Learning + Image Validation Mode in VSE. I have explored core lisa virtualization libraries and there are few classes related to rrpairs protocol. I am just wondering whether i can use those library references and implement my custom class within VSM to achieve this.



  • 4.  Re: Externally feed HTTP rest request / response to virtual service (VSI)
    Best Answer

    Posted Jun 10, 2016 06:33 PM

    Feeding a little off DevTestUser idea and staying inside the DevTest box rather than outside as the architecture and structure of DevTest files are subject to change without notice....

     

    If your R/R pairs are in an accessible directory, you can do most of the work in a headless fashion. 

    - Create a VRS file which supplies the commands such as VSM and VSI names, R/R pair directory, and you can place DPH instructions here as well. 

    - Use ServiceImageManager to process the R/R pairs into a VSI,

    - Then, use SI Manager to merge the newly created VSI into the original service.

    Since the approach is headless, you have an opportunity to evaluate integration into release automation mechanisms.

     

    Refer to:

    ServiceImageManager Command - Manage Service Images - DevTest Solutions - 9.1 - CA Technologies Documentation

     

    One tip: It is a good practice to create a VRS file during your recording via the Workstation as it saves you from having to continually enter configurations -- especially if when DPHs are involved.  Just before you "Finish" out the recording in the Workstation, CLICK the blue folder icon right above the Finish button.  (It is not real intuitive because of its size.)  Save the VRS configuration to the file system, and DevTest will create a well constructed VRS file.  This technique is much easier than trying to figure out how to create a VRS from scratch.  You can do this for many different protocols as well.  JMS for example looks different.



  • 5.  Re: Externally feed HTTP rest request / response to virtual service (VSI)

    Posted Jun 13, 2016 12:41 PM

    Thanks Joel. It will be very helpful. I will explore more on Service Image Manager. As you have mentioned this approach as head less, so i believe I can update VSI at runtime with this SI manager or do i need to build VSI/VSM using VSR and redeploy the service ?



  • 6.  Re: Externally feed HTTP rest request / response to virtual service (VSI)

    Posted Jun 13, 2016 12:57 PM

    The SI Manager does not dynamically update the VSI/VSM asset that is running in VSE.  The SI Manager works on the source assets so the notion would be to use SI Manager to create a new VSM/VSI asset from the source code and new R/R pairs.  In a way, it is sort of like updating the running asset except that one must intentionally deploy the new asset.  Since you are working with source assets, one could place them under source control for purposes of versioning and backing out unintended changes.