Service Virtualization

Expand all | Collapse all

copy the metadata (headers) from request and pass it to metadata (headers) in response ?

Jump to Best Answer
  • 1.  copy the metadata (headers) from request and pass it to metadata (headers) in response ?

    Posted 05-20-2018 06:11 AM

    Hi .. Is there anyway to copy the metadata (headers) from request and pass it to metadata (headers) in response ?



  • 2.  Re: copy the metadata (headers) from request and pass it to metadata (headers) in response ?
    Best Answer

    Posted 05-20-2018 08:07 AM

    To automatically correlate any values of the request, those values need to be arguments. So, you need to copy the metadata values to arguments.

     

    You do this by adding the Request Data Manager Data Protocol Handler to your stack of DPHs, when generating your virtual service in Workstation. In the RDM panel, select your transaction so it appears in the rightmost panel. Press the + button under the bottom panel, and choose to copy. Select the metadata value in the rightmost panel and press the "Source" button. In the bottom panel, you want your copy to be "argument".

     

    Do the above for each of the metadata values you want to copy.

     

    When the generation has completed, your copied metadata values are shown in the list of request arguments, so take a look at your response metadata. It might have abstracted the values automatically. If it hasn't, you want to select the response metadata you want to correlate, put that value in a comment, surrounding it with the DevTest property substitution. This would look like all other magic string values, something like this:

    {{=request_yourArgumentName;/*default_metadata_value*/}}

    Also see this Communities discussion regarding response metadata substitution.

     

    Finally, you probably don't want to do specific transaction matching on metadata, as that is not what metadata is usually designed for. So, in the "request" panel on the right side of the VSI, you want to set your argument matching for any value that you won't match against to "anything". At the bottom of this panel is a little icon to open a dialog box for mass-replacing matching rules for all your transactions, so you can change matching to "anything" for your argument in all transactions.