Service Virtualization

 View Only
  • 1.  Async Test Case

    Posted Oct 29, 2020 08:51 AM
    Edited by tamika moody Oct 29, 2020 11:21 AM
    Is it possible to create a vsm that receives a transaction  - validate some header data and set a header  and send it to a different backend?  I tried creating one by adding a REST STep but the Headers that I set in the VSI is not passed on to the backend.   I tried a REST Step and a Live Invocation step.


  • 2.  RE: Async Test Case
    Best Answer

    Posted Oct 29, 2020 12:10 PM
    I have figured out how to reference the header values  using the following {{=request_...}} but I am curious what property is the "response" body in?  transient?


  • 3.  RE: Async Test Case
    Best Answer

    Broadcom Employee
    Posted Oct 29, 2020 12:30 PM
    Hi Tamika,

    Are you trying to add headers to your request and call another endpoint in the VSM based on what VS receive? If so, run the VSM in ITR in Workstation and a send a transaction against it. Once the VS goes through all the steps, you can stop the ITR and export all the properties in Properties tab. This can be done by:
    . You should see a green arrow in the bottom of the ITR-->Properties. Click on the arrow which opens window.
    . Select Export all which will export all properties to the run time.

    If you are looking for the headers to make it as properties then you can use the Request Copier DPH also. 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

    Then in VSM-->Listen step, you can create filters on VSE request and you can use those filters in REST step.

    If you want to modify the request headers to goto the Live endpoint then you need to modify the current transaction data using Scripted assertion. If you open a support ticket then support can do WebEx and look into the functionality you are looking.

    Prema




  • 4.  RE: Async Test Case

    Posted Oct 29, 2020 01:09 PM
      |   view attached

    Are you trying to add headers to your request and call another endpoint in the VSM based on what VS receive.
    Yes  I was able to get the headers that I needed. 

    however what is failing now is the "content" in the rest step.  I am trying to figure out why my properties are failing in the REST step.    I saved the incoming request in an argument  - Message: Unable to load state object for key =request_string_local_name_req_body_.  Not sure how to extract the value of this property?




  • 5.  RE: Async Test Case

    Posted Oct 29, 2020 02:26 PM
    I was able to figure it out. I guess there is a difference between referencing a property vs referencing the value.  {{=request_string_local_name_req_body_}} did not work but I replaced it with =request_string_local_name_req_body_ it worked fine. 





  • 6.  RE: Async Test Case

    Broadcom Employee
    Posted Oct 29, 2020 02:40 PM
    Good to hear that issue is resolved Tamika.