Service Virtualization

 View Only
  • 1.  Virtual Service, how to get header

    Posted Oct 30, 2018 08:51 AM

    Hello,

     

    We have a virtual service which need to get header values in order to select the good response.

     

    Can we use the filter "Parse HTML Result for HTTP Header Value" or shoud we write a script like specified in post How to get the Request headers in Lisa or is there any default property Lisa creates that captures the request headers. 

     

    Best regards ?

     

    Benoit



  • 2.  Re: Virtual Service, how to get header

    Broadcom Employee
    Posted Oct 30, 2018 09:58 AM

    Hi Benoit,

     

    Before resorting to scripting, I would try to add a Request Data Manager DPH to your filters in the Listen step and move or copy all the required headers within your request object from metadata to actual arguments.

     

    Cheers,

    Danny



  • 3.  Re: Virtual Service, how to get header

    Posted Oct 31, 2018 12:01 PM

    Hi Danny,

     

    I have added a DPF "Request Data Copier". Now I can use the new arguments (generated from headers) in the response body. For example : {{=meta_Connection}}

    But I cannot use them as arguments in "Request Data" table, arguments used for the response selection.

    Did I miss something ? 

     

    Best regards,

     

    Benoit



  • 4.  Re: Virtual Service, how to get header
    Best Answer

    Broadcom Employee
    Posted Oct 31, 2018 01:06 PM

    Request Data Copier copies values from your request object into the testExec environment and as you noticed you can then use them later on as magic strings.

     

    You need to use the Request Data Manager DPH if you want to “transform” the structure of your request object. With RDM DPH you can move or copy a metadata value into the arguments list.

     

    Cheers,

    Danny



  • 5.  Re: Virtual Service, how to get header

    Posted Nov 12, 2018 03:33 AM

    Thanks for your help.



  • 6.  Re: Virtual Service, how to get header

    Posted Oct 31, 2018 01:11 PM

    Hi,

     

    You can move the metadata to arguments like below using RDM (Request Data Manager).

     

    BR

    Venkata



  • 7.  Re: Virtual Service, how to get header

    Posted Nov 12, 2018 03:33 AM

    Thanks for your help.



  • 8.  RE: Re: Virtual Service, how to get header

    Posted Oct 21, 2020 12:29 PM
    Hi,

    Can i use above approach to have the dynamic header values which are sent in request, to be present in response headers as well


  • 9.  RE: Re: Virtual Service, how to get header

    Posted Oct 22, 2020 01:36 AM
    Hi Ankit,

    Try using Request Data Copier for the same.

    Request Data Copier documentation is available at https://techdocs.broadcom.com/us/en/ca-enterprise-software/devops/devtest-solutions/10-6/using/using-service-virtualization/using-devtest-workstation-with-service-virtualization/creating-service-images/using-data-protocols/request-data-copier-data-protocol.html

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------