Service Virtualization

Expand all | Collapse all

different responses , ACK and success response using same request

  • 1.  different responses , ACK and success response using same request

    Posted 10-28-2018 07:22 PM

    Hi ,

     

    i have a requirement, same request and different responses .

     

    Ex: the first response need to send ack 200 and 2nd response need to respond to  different endpoint with request magic string validation.

     

    could you please suggest me



  • 2.  Re: different responses , ACK and success response using same request

    Posted 10-29-2018 01:49 AM

    Hi,
     
    Could you please give us detail information below?
    1. DevTest Version
    2. Transport Protocol in your virtual service
     
    Thank you



  • 3.  Re: different responses , ACK and success response using same request

    Posted 11-04-2018 04:59 AM

    Hello YusukE,

     

    Thanks for the reply. We are using devtest 10.2.1 and the transport protocol is HTTP/S ( HTTP).



  • 4.  Re: different responses , ACK and success response using same request

    Posted 11-05-2018 02:51 AM

    Hi,
     
    This is not a dowloadable version DevTest 10.2.1, maybe 10.2.4 or 10.1.0, I assume.
    If your first response has the HTTP status code as 302, then it is easy to write the meta-data for the first response like:

    Then the response is redirected to the new URL.

    However, if the HTTP status code for the first response is 200(you mentioned that the ack 200), then I do not have any samples which are suitable your requirement.
    I am not sure your can realize the requirement.
    But if you can modify the body of the first response in your VSE file, then please try to add the javascript to the first response body and to write the script to open the next URL.
     
    If you use only out-of-box features in DevTest Service Virtualization, then I think you cannot realize this requirement.
     
    Thank you,



  • 5.  Re: different responses , ACK and success response using same request

    Posted 11-05-2018 02:55 AM

    Hi,

     

    If these are HTTP/S calls then basically you are not dealing with a single virtual service but instead you are building a back-end asynchronous orchestration (albeit a simple one).

     

    This will not be OOTB, you will have to adapt your .vsm. Instead of letting the Respond step flow back to the Listen step you will need to add a WebService Call or REST step in between.

     

    If you need to make the success response call dynamic using data coming from your request then you will need to add a Request Data Copier DPH to your Listen step and copy the arguments using a prefix like “response”. Whatever you like but don’t use “request” and also you cannot depend on magic stringing in the .vsi because the Respond step deletes all properties with name request_* from the environment, so you won’t have those available when you do your success call.

     

    Cheers,

    Danny



  • 6.  Re: different responses , ACK and success response using same request

    Posted 11-08-2018 10:58 AM

    Hello Danny,

     

    we have the above requirement for Performance testing. The requirement is we have received the request from consumer and need to respond back with 201 ack response and again we have to send to validated response for same request.

     

    As you said can you please clarify more on Request data copier and what are the steps need to use for the requirements 

     

    Thanks,

    Nagaraj