Service Virtualization

 View Only
  • 1.  Can we Hold the Response of virtual Service in Devtest.....?

    Posted Sep 20, 2022 06:45 AM
    for my Virtual service 3 responses to send  for a request in Devtest, is it possible to hold the 2nd response after 1st response sent from virtual service...?


  • 2.  RE: Can we Hold the Response of virtual Service in Devtest.....?

    Broadcom Employee
    Posted Sep 20, 2022 10:40 AM
    Hi Sravankumar,

    HTTP requests are 1 request and 1 response. What you mean by holding the 2nd response? Is it into a property or sending the 2nd response as a request to another endpoint or something else?

    Regards,
    Prema


  • 3.  RE: Can we Hold the Response of virtual Service in Devtest.....?

    Posted Sep 21, 2022 01:52 AM
    Its XML request& responses and IBM MQ Protocol .For single request we have multiple responses ,in that we need to hold the Second response after first response sent. After the confirmation , need to release the second response, vice versa for third response. is there any way possible to hold the responses like this.


  • 4.  RE: Can we Hold the Response of virtual Service in Devtest.....?

    Broadcom Employee
    Posted Sep 21, 2022 02:17 AM
    Hi,

    Yes, this is supported out of the box.

    In the VSI you can define multiple responses for one request. You can find
    this in the Virtual Service Editor, select a transaction and select the
    response for that transaction. In the top right of this response pane there
    are a number of controls to create multiple responses: one control shows
    which number of control you are looking add, a control to add one, controls
    to move forward or backward through all the controls.

    You can define specific think times for each separate response.

    Cheers,

    Danny Saro

    Client Services Consultant

    Broadcom Software


    -------------------------------------------------

    --
    This electronic communication and the information and any files transmitted
    with it, or attached to it, are confidential and are intended solely for
    the use of the individual or entity to whom it is addressed and may contain
    information that is confidential, legally privileged, protected by privacy
    laws, or otherwise restricted from disclosure to anyone else. If you are
    not the intended recipient or the person responsible for delivering the
    e-mail to the intended recipient, you are hereby notified that any use,
    copying, distributing, dissemination, forwarding, printing, or copying of
    this e-mail is strictly prohibited. If you received this e-mail in error,
    please return the e-mail to the sender, delete it from your computer, and
    destroy any printed copy of it.




  • 5.  RE: Can we Hold the Response of virtual Service in Devtest.....?

    Posted Sep 22, 2022 04:33 AM
    Hi Danny Saro,

    we know the Creation of multiple
    responses in VSI and thick time also we know about that, but the requirement here is,

    * I wanted to hold the release of 2nd response until & unless we get the confirmation from user,  after the 1st response sent,

    * suppose if we get the confirmation we have to release 2nd response and similar way we have to hold the 3rd response,
    it means for each and every response has to release once we get the confirmation form user
    is it possible with Devtest for hold the responses for above mechanism

    Thanks
    Sravan S


  • 6.  RE: Can we Hold the Response of virtual Service in Devtest.....?

    Broadcom Employee
    Posted Sep 22, 2022 06:54 AM
    Hi,

    Hi,

    I assume what you call a "confirmation" is just another request message
    being put on the same queue as the original (1st) message?
    If the 2nd and 3rd response needs to contain data that is only available
    from in the original request (and response) then I believe the easiest way
    would be to create conversations, ie. a stateful virtual service. That way
    a first confirmation message that is coming in will be automatically
    assigned to the conversation instance started by the original request, and
    the 2nd response has access to all the data properties that were created
    when the original request was processed and the 1 response was returned.
    Similar for the 2nd confirmation.

    If the queue on which the confirmation is received is different from the
    original then that would be implemented in a different virtual service and
    you would have to communicate data between the 2 virtual services using
    scripting and by using the SharedModelMap.

    Cheers,

    Danny Saro

    Client Services Consultant

    Broadcom Software


    -------------------------------------------------

    --
    This electronic communication and the information and any files transmitted
    with it, or attached to it, are confidential and are intended solely for
    the use of the individual or entity to whom it is addressed and may contain
    information that is confidential, legally privileged, protected by privacy
    laws, or otherwise restricted from disclosure to anyone else. If you are
    not the intended recipient or the person responsible for delivering the
    e-mail to the intended recipient, you are hereby notified that any use,
    copying, distributing, dissemination, forwarding, printing, or copying of
    this e-mail is strictly prohibited. If you received this e-mail in error,
    please return the e-mail to the sender, delete it from your computer, and
    destroy any printed copy of it.




  • 7.  RE: Can we Hold the Response of virtual Service in Devtest.....?

    Posted Sep 24, 2022 08:02 AM
    Implemented this long back for SOAP over http service ,same will work for MQ .
    We stored responses to be sent later in Database with unique key like order id mapped to it ,as and when the need arises or on the basis of other incoming request it can be pciked up from database and sent .

    We built a monitor for this that reads the messages using specific logic and posts that message to the queue or HTTP endpoint .
    One of the column in database table was status which was set to Saved intially ,when response is stored initially ,Then it is set to scheduled when it needs to be sent and finally once it is sent sattus is updated to sent so that monitor does not picks up the response again unless status manually set to Saved or Scheduled.
    Apart from that a timer column can be added in millisecond to send the response after specified time .
    Monitor scans DB for responses every minute to send the response asynchronsly or can be run manually from CVS if required .
    Consumer picks up the response on basis of message id or any other unique id in the response itself.

    Our Use case was : Customer places an order and we need to send the responses in specific durations like below
    Order created : Immediately once request is recieved 
    Order accepted : 2s
    Order in Progress: 5s
    Order completed : 10s
    Sometimes response was sent manually and multiple times whenver required
    If DB is unavaible text files can be used to store individual response,limitation being it will consume too much space on server

    ------------------------------
    Regards
    Rahul V
    ------------------------------



  • 8.  RE: Can we Hold the Response of virtual Service in Devtest.....?

    Posted Sep 29, 2022 12:08 PM
    Hi Sravan,

    There are different ways to achieve the same.

    These will be applicable for Non-HTTP services mostly:

    Option one: You can have the condition defined for your request to identify which response to be sent first and set the operation name accordingly (using script or SDP).

    Option two: Create two set of services, one will identify which service responses to sent and the second service will send the same (invoke second service within first service)

    Thanks

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