Service Virtualization

Expand all | Collapse all

Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

  • 1.  Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Aug 27, 2015 08:29 AM

    Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?



  • 2.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Sep 24, 2015 10:08 AM

    Hi Rohan,

     

    Could you please let us know what is the protocol you are using to virtualize and tell us in brief.

     

    Thanks,

    Abhishek



  • 3.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Sep 30, 2015 10:32 AM

    Hi Abhi,

     

    I am using HTTP/S , I have added two responses in response tab in vsi . But I am getting only response when I test from my soap ui .

     

     

     

     

    Repsonse 2 of 2 is not displaying .

     

    Regards,

    Rohan Doshi

    Tech Mahindra | IBU TUS-05 | TB-Test –Dispatch-EDGE

    Mobile: +91-9527319798 | Ext: 6-256536

      Email: RD00424421@TechMahindra.com<mailto:RD00424421@TechMahindra.com>



  • 4.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 01, 2015 06:04 AM

    Hi Rohan,

     

    When you use the Response 1 of 2 and Response 2 of 2 option in VSI, it will show only one response that would be the first response which you have configured in your VSI. But the two responses can be seen in the ITR Mode in the "VS Image Response Selection" under "Properties" tab in the "LASTRESPONSE" value.

     

    This type of getting two responses cannot be done in HTTP transport protocol but it can be implemented in the JMS and MQ transport protocol.

     

    Refer the below thread for more information, you will get to know more:

     

    https://communities.ca.com/message/241820205#241820205

     

    Revert if you have any more doubts on this.

     

    Thanks,

    Abhishek



  • 5.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 01, 2015 07:16 AM

    Hi Abhi,

     

    I need two responses one after another i.e may be by delay of 1 sec . As I understood we can add this step before image response selection step . right ?

    Can you share code to do this .

     

    Below suggestion I received from our discussion forum :

    §  Yes, you will see two responses, and if you can create the service from rr pairs directly, then no need to record.

     

    if you want a different response for the same request, then use some other sequence / time counter to increment as a key arg value,  you can add  this as a request argument using a custom filter or a script

     

     

    Can you share code for above suggestion how to implement exactly.

     

    Regards,

    Rohan Doshi

    Tech Mahindra | IBU TUS-05 | TB-Test –Dispatch-EDGE

    Mobile: +91-9527319798 | Ext: 6-256536

      Email: RD00424421@TechMahindra.com<mailto:RD00424421@TechMahindra.com>



  • 6.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 01, 2015 07:23 AM

    I don’t think protocol matters if we write a code .

     

    Regards,

    Rohan Doshi

    Tech Mahindra | IBU TUS-05 | TB-Test –Dispatch-EDGE

    Mobile: +91-9527319798 | Ext: 6-256536

      Email: RD00424421@TechMahindra.com<mailto:RD00424421@TechMahindra.com>



  • 7.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 01, 2015 07:46 AM

    Hi Rohan,


    In HTTP protocol, when the response 1 is recieved then the service is not expecting the second response as it kills the previous thread.

     

    If you want to apply code on this then I dont have any idea about it and I have tried but did'nt get the response for the second one.

     

    You can apply delay using Javascript step in the VSM but still it doesn't matter.

     

    Let me know on this once you will successfully implement it and once done please post it here.

     

    Thanks,

    Abhishek



  • 8.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 01, 2015 08:35 AM

    I got your point Abhi , can we do like this :

     

    1)      Take any Argument name in variable from req for e.g X

     

    2)      If variable = X then respond from 2 diff vsi (internally can we send two diff req in LISA to vsi ? ) is it posi ?

     

    Also can you please share code for MQ or any oder protocol implemented . I will try by looking at it .

     

    Regards,

    Rohan Doshi

    Tech Mahindra | IBU TUS-05 | TB-Test –Dispatch-EDGE

    Mobile: +91-9527319798 | Ext: 6-256536

      Email: RD00424421@TechMahindra.com<mailto:RD00424421@TechMahindra.com>



  • 9.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 01, 2015 10:14 AM

    Any suggestion ?

     

    Regards,

    Rohan Doshi

    Tech Mahindra | IBU TUS-05 | TB-Test –Dispatch-EDGE

    Mobile: +91-9527319798 | Ext: 6-256536

      Email: RD00424421@TechMahindra.com<mailto:RD00424421@TechMahindra.com>



  • 10.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 01, 2015 10:49 AM

    Hi Rohan,

     

    Still it can't be implemnted because the request will be coming in one of the VSI and after that the response will be given to you i.e., 1st response and after that for 2nd response still the Soap UI is not expecting because we need to trigger for 2nd reponse inorder to get the same. I dont have any clue how we can implement it.

     

    Thanks,

    Abhishek



  • 11.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 01, 2015 05:34 AM

    Regards,

    Rohan Doshi

    Tech Mahindra | IBU TUS-05 | TB-Test –Dispatch-EDGE

    Mobile: +91-9527319798 | Ext: 6-256536

      Email: RD00424421@TechMahindra.com<mailto:RD00424421@TechMahindra.com>



  • 12.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Sep 29, 2015 08:15 PM

    Yep - which protocol and how does the virtual service know which response to use (i.e. are there specific arguments in the request that tie to a response)?



  • 13.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Sep 30, 2015 03:45 AM

    I came to know that we can add multiple responses in vsi by click on Add new response button .So my response tab will look like “Response 1 of 2 “ … “Response 2 of 2” . and when we hit a request matching in vsi these two responses will be displayed .

     

    Regards,

    Rohan Doshi

    Tech Mahindra | IBU TUS-05 | TB-Test –Dispatch-EDGE

    Mobile: +91-9527319798 | Ext: 6-256536

      Email: RD00424421@TechMahindra.com<mailto:RD00424421@TechMahindra.com>



  • 14.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 02, 2015 10:39 AM

    Hi Roshan,

     

    As per my understanding for any incoming request to VSI lisa will pick up the first match as per the match style and send the respective response. Even if you have two responses created in VSI it will not send both for one single request.

     

    Regards,

    Ashish



  • 15.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 05, 2015 07:08 PM

    We managed to create and deploy this scenario. We were using HTTP/s protocol . We also created a virtual service where responses were randomized. This will pick one random response and send it, repetition is possible and does happens.

     

    Regards

    Khagendra.



  • 16.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 06, 2015 02:37 AM

    Hi ,

     

    Can you please share the steps OR code how to create this .



  • 17.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 06, 2015 04:06 AM


    Hi KPMuthe_Echostar,

     

    Could you please let us know how you have implemented it.

     

    Thanks,

    Abhishek



  • 18.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Oct 07, 2015 03:55 AM

    Hi KPMuthe_Echostar

     

    Could you please let us know how you have implemented it.

     

    Thanks,

    Abhishek



  • 19.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Jan 27, 2016 12:37 AM

    Hi

     

    This is exactly what i need to implement. Can u help me with this please?

    I need to use a HTTP/S protocol.The requirement is : i have a request and 3 responses.(RR Pairs), now as i send the request, i should get the response based on the think time, like say I give the request, I should get the first response if the think time is 15s, second response if the thinktime is 30s and third response if the think time is 45s. How can i achieve this? 



  • 20.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 01, 2016 05:47 PM

    Hi Rohan,

     

    There are multiple implementation techniques for addressing this issue.

     

    Using OOTB:  Example:  Allow the VSI to return one of three responses for a given request:

    - Let's assume that your specific transaction in the VSI has several responses (1 of 3, 2 of 3, 3 of 3)

    - If you CLICK on the META transaction and look in the Transaction Basics (upper right) portion of the screen, you will see a Check Box for Allow Duplicate Specific transactions

    - If you enable allow duplicate specific transactions, the VSI will return the 1st response the first time the service image matches this response, the 2nd response the second time the txn matches and the 3rd on the 3rd, etc. etc.  The Service Image response will 'start over' once all three responses, in this example, are sent.

    - Each response can have its own Think Time setting and the service (VSM) will honor that think time unless you override the Think Scale in the Server Console.

    - The responses are sent serially not randomly.  Stop/start the service to 'reset' the order back to the 1st, then 2nd, then 3rd, etc.

     

    Custom:

    You can enhance both the Service Model and Service Image using various techniques.  Following is a description of just one way to do this.

    Example uses the same three responses above except that this example will programmatically control when a given response is selected based on the generation of a random number between 0 and 100:

     

    Service Image (VSI):

    - Make 2 of the 3 responses specific transactions, and leave 1 (the most common response) as META for the Operation

    - Rather than having one specific transaction with 3 responses, your Service Image now contains 1 META and 2 specific transactions each having 1 response

    - You need to identify an argument on the request for this operation that can act as a tie breaker to identify the proper response.  Assume you need to add an argument that does not exist on the incoming request.

    - In the Service Image, editor add an argument (let's call it lisaCustomField).  When you do this, your incoming request knows nothing about lisaCustomField, so you have to add code in the Service Model to add this argument and a value.

     

    Service Model (VSM):

    - In this example, we will use the LISTEN Step and add a Scriptable DPH after the SOAP filter.  The Scriptable DPH will create the argument and set its value for each incoming request, or only when the request meets some specific requirement.

     

    For example:

     

    import com.itko.util.ParameterList;

    // get the request argument list parsed by soap dph

    ParameterList args = lisa_vse_request.getArguments();

     

    // Checking for operation match, otherwise this argument will be added to every incoming request regardless of operation

    if  ("yourOperationName".equals(lisa_vse_request.getOperation() )

    {

        // add your logic here to determine which response you want selected.

        // set a value in the custom argument to help you identify your specific response

     

     

         // for example using a random number, you could do this   

         int randomNumber = (new Random()).nextInt(101);

         if (randomNumber < 51) 

             args.addParameters("lisaCustomField=10s");     // 0 to 50 will send META

         else if (randomNumber < 81) 

             args.addParameters("lisaCustomField=30s");     // 50 to 80 will send 30 second Think

         else

             args.addParameters("lisaCustomField=45s");     // 81 to 100 will send 45 second Think

    }

     

    NOTE: No syntax check applied to the above.  The code is just representative of what you might do.

     

    Back in the Service Image (VSI):

    The specific txns in the VSI (for the Operation) must cater for this new field (to prevent Service Image mismatches)

    The request argument name (lisaCustomField) must match the value you used in the Scriptable

    Also set up the Comparison Operator and Comparison Value.  For example:

    Specific Txn 1    incoming arguments and their comparisons plus lisaCustomField   Comparison Method (equal)   Value (30s)

                               Modify  the Response Think Time to 30000 ms (or 30 seconds)

    Specific Txn 2    incoming arguments and their comparisons plus lisaCustomField   Comparison Method (equal)    Vakye (45s)  

                              Modify the Response Think Time set to 45000 ms (or 45 seconds)

    META                Meta response just change the Think Time to what ever value you want

     

    Kind Regards,

    Joel



  • 21.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 01, 2016 09:12 PM

    Hi Joel,

     

    I was trying to implement the approach you told in the first part of your reply in LISA7.5.2 for REST/JSON service i.e Having 2 responses in a single transaction(Response 1 of 2 and Response 2 of 2) having 2 different JSON Responses, but as soon as I save the VSI, both the response outputs are changed to one of them. i.e now in both the responses (1 of 2 and 2 of 2), same json response is present.

     

    Why Lisa is automatically changing the responses. Is this feature not working in Lisa7.5.2?

     

    Kindly let me know on the same.

     

    Thanks,

    Vinit



  • 22.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 01, 2016 11:34 PM
    I have not witnessed the VSI behave the way you described the scenario.


    So I understand, you have a VSI with a transaction with 2 responses.  1 of 2 has JSON Response A and 2 of 2 has JSON Reaponse B.  When you save and open the VSI, the JSON Response 1 and 2 are now both the same?  I have never seen the VSI editor do that.




  • 23.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 02, 2016 12:55 AM

    Ya exactly. That's what happening in LISA 7.5.2.  If you have this version you can try. Probably thats the bug in this version?



  • 24.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 02, 2016 09:12 AM

    Hi Vinti, I tried to recreate this issue using my version of 7.5.2.235.  My version did not experience the issue you are describing.

    Following are the steps I performed. 

    1) Opened a JSON-based VSI using Workstation

    2) Copy/Pasted an existing operation, added a name "test_" to the beginning of the operation to make it unique.

       - I went ahead and saved the Image after this step but I did not close the VSI

    3) CLICKed on the META for the copied Operation and Enabled Allow Duplicate Specific Transactions

    4) CLICKed on Specific Transaction

       a) Copied the response (1 of 1)

       b) Added a new response and set the document type to JSON

       c) Pasted the Response into 2 of 2

       d) Edited Response 2 of 2 and changed some of the values so they are different from both response 1 of 2 and META

       e) Edited META and changed some of those response values to contain 'META  ( If the overlay happened, I wanted to see if META or the 1 of 1 response was being replaced into response 2 of 2)

    5) Saved VSI

    6) Closed VSI

    7) Opened VSI and the transactions retained the values I edited.

     

    I did not attempt to playback the service as your issue appears to be related to creating and editing the VSI.  If you are having this problem, you may need to open a ticket with support through your specific support site ID.

     

    Regards, Joel



  • 25.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 02, 2016 05:19 PM

    Hi Joel,

     

     

    I am able to solve the issue of Response 1 and Response 2 now. I can see three different responses in Meta, Response 1 of 2 and Response 2 of 2. The checkbox is also checked but when I tried running the VSM in ITR mode by hitting request from SOAP UI, I saw that every time response 1 was being returned. Kindly let me know on the same.

     

    On the other hand, I tried in the manner described below and was able to get alternative responses but still I want to learn the method you told as its quite straight forward.

    ***************************************************************************************************************************************

    In order to send responses in an alternative fashion, we can perform below mentioned things:-

     

    1) Add a Data Set "Create a numeric counting data set" in the Listen Step and set values as from 1 to 100 and name it as a property Loop.

    2) Add a Scriptable Data Protocol with the below mentioned Code:- (Make sure the Filter in set as lisa.vse.request) in the Scriptable Data Protocol.

    import com.itko.util.ParameterList;

     

    ParameterList args = new ParameterList();

    args = lisa_vse_request.getArguments();

    args.addParameters("Loop=val1");  // this will add an argument named Loop in the VSI transactions during run time.

    lisa_vse_request.setArguments(args);

     

    3) Add another Scriptable Data protocol filter in any step before VSI step and mention the below code:-

     

    import com.itko.util.ParameterList;

     

    ParameterList args = new ParameterList();

    args = lisa_vse_request.getArguments();

     

        int loop = Integer.parseInt(testExec.getStateValue("Loop"));

     

    if(loop%2 == 0)

    {

        args.setParameterValue("Loop", "Even");

    }

    else

    args.setParameterValue("Loop", "Odd");

    lisa_vse_request.setArguments(args);

     

    4) In your VSI, add a request argument named Loop in your transaction. make sure you have two transaction for the specific operation for which you are testing

    a) One transaction having request argument named Loop, value as Even (comparison operation "equals")

    b) Other transaction having request argument named Loop, value as Odd (comparison operation "equals")

     

    5) Try running the VSM in ITR mode or by deploying it. So when you will run the ITR, For the first request value of loop will be 1 which is not divisible by 2, so value of Loop will be Odd and hence 4(b) transaction would be fetched and likewise for second transaction, 4(a) would be fetched.



  • 26.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 02, 2016 05:32 PM

    Hi Vanit, I do not know if ITR mode works the same as VSE with regard to how duplicate responses are handled.  I would consider deploying the service to VSE and use a Test Case or SoapUI to make the call repetitively.  If everything is set up correctly, you should see the responses changing.  This is how KPMuthe_Echostar got his service(s) to do this.

    Thanks, Joel



  • 27.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 08, 2016 01:00 AM

    Hi Joe,

     

    I tried deploying service also but still the same case. FYI I am using a REST/JSON based service on LISA7.5.2.  Although it is not my requirement but just was curious to know why it is not working. May be some bug in 7.5.2

     

    Thanks,

    Vinit Malhotra



  • 28.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 08, 2016 07:12 PM

    Hi Vanit, I have not seen any issues with this feature in r7.5.2.  This type of response has been OOTB for quite some time.  Is it possible to upload a sanitized version of your VSI and VSM, after removing any proprietary customer data of course?  Thanks, Joel  



  • 29.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 11, 2016 08:27 AM
      |   view attached

    Hi Vanit, please look at the attached project.  The service and test case demonstrates duplicate response processing.

    Notice in the VSI that the operation's META transaction is checked as Allow Duplicate Txns.  Then Notice that the specific TXN is actually duplicated.  The first specific txn contains a response of "Even" and the other contains "Odd".

    Open the config and change the ENDPOINT and PORT properties to point to your VSE and desired port.

    Deploy the VSM.

    Open the Test Case called MultiResponse_Test and run it in ITR mode.  You will see the responses "Even", "Odd", "Even", "Odd", ...

    I mislead you in stating that 1 of 2 and 2 of 2 in the VSI was the approach.  My apologies for the confusion there.

    Regards, Joel

    Attachment(s)

    zip
    MultiResponse.zip   13 KB 1 version


  • 30.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 11, 2016 07:49 PM

    Hi Joel,

     

    I cant find any attachment as you mentioned in your reply.

     

    Thanks,

    Vinit Malhotra



  • 31.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 11, 2016 08:41 PM
      |   view attached

    I see the attachment when I look at my earlier reply.  I am attaching it again here.  Perhaps something is going wrong in the Community. The attachment was / is called MultiResponse.zip

    Attachment(s)

    zip
    MultiResponse.zip   13 KB 1 version


  • 32.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 12, 2016 12:47 AM

    Yeah, i still cant see



  • 33.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 15, 2016 08:39 PM

    Hi Joe,

     

    Can you send it to my email  vinit.malhotra@anz.com. I will have a look at it.



  • 34.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 16, 2016 07:59 PM

    Hi Joe,

     

    Thanks alot for your email. I think we were taking about different things. In the Project you have shared with me you have exactly copy of a specific transaction which is working fine i.e alternatively. I was having two responses in same transaction i.e Response 1 of 2 and Response 2 of 2.

     

    I tested it with more than 1 response also and it was working sequentially. Thanks alot for your support on this. RohanDoshi This solution is working fine. Simple copy the transaction and paste in VSI. You can copy "N" number of transactions and paste. Make sure you check the checkbox in Meta response.

     

    The VSI will select respond from one transaction, then another and go on......You dont have to use any code or any Filter etc.....You can mark this as "Answered"

     

    J_NeSmith I have one another question for you which is not related to this. I want to know the significance of using Match Script and what is the real time example in which we get a need to use Match Script. I would be highly obliged if you could let me know on this.

     

    Thanks,

    Vinit



  • 35.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 17, 2016 03:52 AM

    Hello Vinit ,

     

    I have also used the model shared by J_NeSmith, it is working fine for multiple responses.

    Thank you Joel.

     

    Regards,

    Vijay Chandra Sidharth



  • 36.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 17, 2016 10:07 AM

    Hi Vinit, I believe there may be some other discussions and examples of match scripts in the Community and the CA documentation so they may provide more help / guidance.

    The significance of the Match Script is that it allows a developer to override the DevTest Request matching (or comparison) behavior.  When you use the Match Script, your code is responsible for implementing the operation and argument checking behavior specific to your Use Case.

    In terms of a real world Use Case, I always try to find a way to utilize OOTB DevTest transaction matching.  I personally use Match Scripts as a last resort not a first resort.  The power of the Match Script creates a potential maintainability issue for your service over the long term.  Also, the Match Script is sort of buried between the Request and Response panes in the Workstation.  It is very easy to look at a VSI and not pick up on the fact that a Match Script is in use.

    A common usage of Match Scripts may be to incorporate Data Driven Responses where values from the request are used as query parameters to a data source in order to select the variable data substituted into the response.

    Now, if you are thinking that a match script would enable your code to determine which response to send (Response 1 of 3, 2 of 3, or 3 of 3), I have not seen nor attempted that implementation.  The matches script is used to select or "land on the" Response.  I have never seen a matches script used to select one of the three responses for a specific transaction.  Under the hood, once DevTest determines the response that will be sent, a lisa_vse_response object is created.  This object is a List containing each of the responses (1, 2, and 3 of 3) as a Response object.  In the HTTP world, DevTest follows the pattern that there is only 1 response to a given request, so in the VSM Responder step, the response sitting at the first occurrence of lisa_vse_response list is the response that will go on the wire.  I have overridden this behavior in HTTP VSMs before.  After the Service Image Selection Step fires, I have used custom script to get the List, iterate over it for the Response object I wanted, and set that object to be the one sent by the Responder step.  If you have JMS VSMs, you are likely to see this behavior.  The Responder step contains a loop that iterates over the response list and puts messages on the output queue until the list has been exhausted.  This is very common in JMS.  It is not common in HTTP because the pattern is one request to one response.  Hope this helps, Joel



  • 37.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 26, 2016 01:29 PM

    Hi Joel,

     

    I am trying to implement same scenario by single request and return multiple responses using JMS protocol. I have created a vsi have one META and one specific transaction , so my vsi looks like "Response 1 of 3". I have also checked allow duplicate specific transactions. But I am not able to get response. Did I miss something out here ? Please suggest.

     

    Thanks



  • 38.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 26, 2016 03:32 PM

    By "not able to get response" do you mean your client application is timing out waiting for a response?  Also, do you mean you are unable to receive *any* response, or that you are receiving the first response but not the second or third?

     

    If it's just the first response that is working, then make sure your JMS VSM has a loop in it, around the Respond step.  If you are using a stock VSM generated from the VSE Recorder then the loop should already be there.

     

    Try running your VSM in the ITR to make absolutely sure the Respond step actually runs three times per transaction.

     

    Try changing your response queue to some other, unused queue.  Run a transaction and then use another tool to inspect the responses to make sure they look correct.  You can even use the DevTest JMS test step for this; it will show you the payload and all the JMS headers.

     

    If none of that turns up a problem then it's time to figure out what your application actually expects in its responses.  Maybe it's using a different correlation scheme, or possibly a different correlation scheme for each response.  Maybe it is actually receiving the responses but experiencing some other processing error?  You can use the same procedure with a JMS Test step or an external tool to inspect the actual response queue to see whether the response messages remain there or are picked up.



  • 39.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 27, 2016 10:46 AM

    Hi Kevin,

     

    By no response I mean that at Respond step I am getting error message "Value for sender was null". I am testing my VSI through JNDI step. Please suggest what could be the reason for this? Also please provide clarifications for below queries -

     

    1. I have created VSM and VSI using req-resp pairs and JMS protocol. so my vsm is having steps of JSM type, do i need to add any loop on Respond step. If yes then how ?

    2. VSI created from req-resp pairs and JMS protocol contains 1 META and 1 specific transaction, specific transaction contains 3 responses so VSI looks like "Response 1of 3" . Is this approach correct to return multiple responses for a single request ?Or should i do any changes to this ?

     

    Thanks .



  • 40.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 27, 2016 06:10 PM

    > "Value for sender was null"

    I'd have to see a full stack trace to be sure, but I think this means you are missing something in your response meta-data.  What is your exact version of DevTest?  Can you check and make sure each of your responses' meta-data contains the property "channel.name".

    This has nothing to do with your multiple response setup, which sounds correct.

    If you need more help then can you start a new thread?  I believe we've strayed well beyond the original topic of this one.



  • 41.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 26, 2016 01:31 PM

    Hi Vinit,

     

    I am facing similar issues.. Could you please help !

     

    Thanks



  • 42.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 01, 2016 10:13 PM

    Hi Rohan,

     

    In order to send responses in an alternative fashion, you can perform below mentioned things:-

     

    1) Add a Data Set "Create a numeric counting data set" in the Listen Step and set values as from 1 to 100 and name it as a property Loop.

    2) Add a Scriptable Data Protocol with the below mentioned Code:- (Make sure the Filter in set as lisa.vse.request) in the Scriptable Data Protocol.

    import com.itko.util.ParameterList;

     

    ParameterList args = new ParameterList();

    args = lisa_vse_request.getArguments();

    args.addParameters("Loop=val1");  // this will add an argument named Loop in the VSI transactions during run time.

    lisa_vse_request.setArguments(args);

     

    3) Add another Scriptable Data protocol filter in any step before VSI step and mention the below code:-

     

    import com.itko.util.ParameterList;

     

    ParameterList args = new ParameterList();

    args = lisa_vse_request.getArguments();

     

        int loop = Integer.parseInt(testExec.getStateValue("Loop"));

     

    if(loop%2 == 0)

    {

        args.setParameterValue("Loop", "Even");

    }

    else

    args.setParameterValue("Loop", "Odd");

    lisa_vse_request.setArguments(args);

     

    4) In your VSI, add a request argument named Loop in your transaction. make sure you have two transaction for the specific operation for which you are testing

    a) One transaction having request argument named Loop, value as Even (comparison operation "equals")

    b) Other transaction having request argument named Loop, value as Odd (comparison operation "equals")

     

    5) Try running the VSM in ITR mode or by deploying it. So when you will run the ITR, For the first request value of loop will be 1 which is not divisible by 2, so value of Loop will be Odd and hence 4(b) transaction would be fetched and likewise for second transaction, 4(a) would be fetched.

     

    Let me know if you have any issues. I have tried and tested it on LISA 7.5.2

     

    Thanks,

    Vinit Malhotra



  • 43.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 11, 2016 07:20 AM

    Hello Vinit Malhotra,

    I have tried as you suggested. I have created the LISA model through RR pair method(1 Req & 1 Rsp) further added 2nd response. Please find the attached model that i have created.

    Steps added:-

    - Added data set to  'Virtual HTTPS Listener 8005' step(VSM)

    - Added Scripted Data protocol to the same 'Virtual HTTPS Listener 8005' step(VSM)

    - Added 2nd Scripted Data protocol to 'Virtual Service Router' step(VSM)

    - Added 2nd transaction and new Request Argument 'Loop' with values Odd and Even for both transaction(VSI)

    - Added 2nd response

    Running through ITR and execute Request using SOAP UI, here loop is increasing after every execution through SOAP UI but every time same response comes.

    Also attaching the RR files.

     

    Please suggest.

     

    Regards,

    Vijay Chandra Sidharth

    (In Rohan's team)

    Attachment(s)

    zip
    Request-req.xml.zip   373 B 1 version
    zip
    MultipleRsp.vsi.zip   1 KB 1 version
    zip
    MultipleRsp.vsm.zip   2 KB 1 version
    zip
    Response-rsp.xml.zip   369 B 1 version
    zip
    MultipleRsp.rsp.zip   289 B 1 version


  • 44.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 11, 2016 08:07 PM

    Hi Vijay,

     

    I can't find any attachment in your reply. Please find below the steps which i did just now and its working fine for me.

     

    1) While creation of the service i have selected "VS model type as "More efficient", INSTEAD OF "More flexible". which will add one more step in the VSM after HTTP/Listen step named "Parse text as response". I have applied a SDP filter on HTTP/Listen step having script as :-

     

    import com.itko.util.ParameterList;

    import java.lang.String;

     

    ParameterList args = new ParameterList();

    args = lisa_vse_request.getArguments();

    args.addParameters("Loop=val1");  // many at once

    lisa_vse_request.setArguments(args);

     

    2)I am having a step named "Parse text as response" after HTTP/Listen step but BEFORE VSI Image Selection. I have applied a data set on this step for Loop 1 to 10. Name of the Data Set is Loop. Below is the script I applied in SDP filter which is also applied on the step named "Parse text as response":-

     

    import com.itko.util.ParameterList;

    ParameterList args = new ParameterList();

    args = lisa_vse_request.getArguments();

     

        int loop = Integer.parseInt(testExec.getStateValue("Loop"));

    if(loop%2 == 0)

    {

        args.setParameterValue("Loop", "Even");

    }

    else

    args.setParameterValue("Loop", "Odd");

    lisa_vse_request.setArguments(args);

     

    3) In the VSI, for the particular transaction, i have added a request parameter named Loop and having its value as Even.

    4) Added a new transaction, having parameter named Loop with value as Odd.

    (Please note we are not having one transaction with 2 responses, like Response 1 of 2 and Response 2 of 2). We are having entirely different 2 transactions for the same operation having different value of the Request parameter named Loop as "Even" and "Odd".

     

    5) Ran the Service on ITR and hit the request with POSTMAN(which is utility of google chrome).

    I can see the value of loop is 1,2,3,4. and depending upon logic it comes as Odd or Even in the request argument when it comes to VSI. Depending upon the value of the argument, response is selected for Even or Odd.

     

    Hope that helps you!!



  • 45.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 15, 2016 09:18 AM

    Hi Vinit,

    I tried but not able to get the expected result. Can you please share yours service model.

     

    Thanks,

    Vijay Chandra Sidharth



  • 46.  Re: Can we have multiple repsonses for one request and how to configure multiple responses for same request using by defualt features of Dev test ?

    Posted Feb 15, 2016 08:38 PM

    Hi Vijay,

     

    I apologies but I cant share the VSM outside my organizations. Can you share yours at vinit.malhotra@anz.com. I will have a look.