Service Virtualization

  • 1.  Selection logic for setting a response based on comparing 1 parameter from a big request

    Posted Apr 06, 2018 05:01 PM

    Hi,

     

    Can someone help me with below scenario please!!

     

    -->Actual request has 50 parameters.

    -->Based on value of one specific parameter (subscriberName) in the request i have to set response to Route.if the value is something else , set response to 404.

     

    Psudo : if (subscriberName == XYZ)

                    Set route

                    Else set 404

     

    current implementation i used : 

    -->Used match style as : operation 

    -->configured the subscriberName value to a specific value using "=" operand in the request and set response as Route and set 404 in the Meta (if match is not equal).

    --->Problem with this implementation: What ever the value of subscriberName  is, it is always sending response as route(even when subscriberName  is not equal to what is configued.so am never getting 404 in the response.)

     

     

     



  • 2.  Re: Selection logic for setting a response based on comparing 1 parameter from a big request

    Broadcom Employee
    Posted Apr 06, 2018 05:11 PM

    The match would always return route as the specific transaction has match style as Operation.

     

    If you need to match only on one argument - use the RequestDataManager DPH to keep the subscriberName

     

    https://docops.ca.com/devtest-solutions/10-3/en/using/using-ca-service-virtualization/using-devtest-workstation-with-ca-service-virtualization/creating-service-images/using-data-protocols/request-data-manager-data-protocol

     

    The default match style should work in your case with the specific transactions - subscriberName set to match to XYZ returning Route & the Meta transaction returning 404.



  • 3.  Re: Selection logic for setting a response based on comparing 1 parameter from a big request

    Posted Apr 06, 2018 05:29 PM

    Thanks Prem.

     

    But can we use your approach for XML and JSON requests?

    I see you suggestion is for JMS "If you need to match only on one argument - use the RequestDataManager DPH to keep the subscriberName" ....

    Just curious to understand!



  • 4.  Re: Selection logic for setting a response based on comparing 1 parameter from a big request
    Best Answer

    Broadcom Employee
    Posted Apr 06, 2018 06:16 PM

    RequestDataManager dph is a secondary dph which needs to be added after your current dph.

     

    it works on the arguments/attributes/metadata or operation name. It is independent of payload or transport protocol