Service Virtualization

Expand all | Collapse all

Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

  • 1.  Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 12, 2017 06:52 AM

    Hi Team,

     

    Problem Statement:- I want multiple response from Lisa for a single request. It means, only one request we will send and expecting two response one after another for TCP/IP Service Virtualization. Anyone can help in this.

     

    Regards

    Pragati Vijay



  • 2.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 12, 2017 06:33 PM

    Pragati,

     

    For TCP transport protocol, you can create a service image that contains multiple responses to 1 request using request and response pairs.

    The following example has one request and three responses:

       depositMoney-req.txt
       depositMoney-rsp1.txt
       depositMoney-rsp2.txt
       depositMoney-rsp3.txt

    You can find more information in the link below:

    Request/Response Pairs - DevTest Solutions - 10.1 - CA Technologies Documentation 

     

    For playback, I believe you would need to modify your VSM to customize the Responder step to send multiple responses - but I am not sure how it would work with the TCP transport protocol.

     

    Heloisa



  • 3.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 13, 2017 02:43 AM

    Hi Heloisa,

     

    I am not looking for random responses for a single request. I want two response for a single request. We will send a request and then We are expecting two response one by one. Let me know, If you have any solution for this..

     

    Pragati



  • 4.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Broadcom Employee
    Posted Sep 13, 2017 07:54 AM
      |   view attached

    If I understand correctly, TCP has no standard mechanism for this, which means that we can do many things, and need to find the appropriate way of providing what you need.

     

    In DevTest, VSM files can use the "Socket Server" step as a listener and as a responder. I have a VSM that listens on a defined port, and when it receives input to that port, it decides how to respond. If the input is "hello" followed by a newline, it responds with the lyrics to a Lionel Richie song, using each line as a response and with a second between each response.

     

    To test it, deploy the virtual service (it'll show up as a HTTP service on port 8001) and then telnet to the VSE machine on port 8001. You will get a blank response. Type in any string and hit <return> and it'll prompt you.

     

    To support different messages, you can change the data set attached to the response socket servers. Supporting two responses is as easy as changing the "end of data" RegExpression to "2".

     

    This does not bother with VSI files at all - it's a pure VSM-based responder for TCP sockets. Therefore it does nothing like auto-correlation, time-shifting, think time specifications, stateful transactions, etc. I created this virtual service as a joke to thwart developers running "telnet ping" as a test against my deployed HTTP virtual services, as it's a poor test and can cause problems.

     

    I have attached my VSM to this message.

     

    Does this meet your requirement? If not, can you expand on it? I'm sure DevTest can do what you want, but we'll need to know more about what you need to see.

    Attachment(s)

    zip
    lionel.vsm.zip   2 KB 1 version


  • 5.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 22, 2017 05:47 AM

    Hi Rick,

    I executed VSM which you had attached. But I am always getting Default response.



  • 6.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Broadcom Employee
    Posted Sep 22, 2017 05:52 AM

    By "default response" do you mean that it's only returning one line of lyrics back to you (a default response) or do you mean that, when you type "goodbye" you get the whole verse from The Beatles' Hello Goodbye in response (multiple responses to one request)?



  • 7.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 22, 2017 06:06 AM

    I am getting only -"hello or goodbye - rick" in Response



  • 8.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Broadcom Employee
    Posted Sep 22, 2017 06:09 AM

    and so you type "hello" or "goodbye" and ... ?



  • 9.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 22, 2017 06:34 AM

    I tried with both



  • 10.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Broadcom Employee
    Posted Sep 22, 2017 06:49 AM


  • 11.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Broadcom Employee
    Posted Sep 13, 2017 06:22 PM

    Here, I've attached "TCP_TelnetResponder.vsm" along with "TelnetResponder.vsi", which use standard DevTest facilities to respond on TCP port 8002, using multiple responses as Maria described, honouring think times between each response. On my local laptop, it takes perhaps 0.5 seconds to process each response in the transaction list before sending.

    Attachment(s)



  • 12.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 22, 2017 05:52 AM

    When I tried to import this VSM, Getting Build Error. Can you please send me mari file for the same.



  • 13.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Broadcom Employee
    Posted Sep 22, 2017 05:58 AM

    There should be no external dependencies to this virtual service. What is a "Build Error", and does this appear when you open the VSM in Workstation, when you try to open the VSI, when you deploy or when you're running telnet against it?



  • 14.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 22, 2017 06:53 AM



  • 15.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Broadcom Employee
    Posted Sep 22, 2017 07:13 AM

    Given that I can't scroll down a screenshot to see any details of the error, let's try some basic debugging:

    Are you on a recent version of DevTest (one that supports TCP virtual services)?

    Is the error thrown when you open the VSM in Workstation, or at some other time?

    Are there any configuration changes in your installation from a standard DevTest installation?

    Is the installation into a folder structure where you have limited permissions?

    I see that your post is tagged "CA Service Virtualization - Community Edition". Are you using this product, or full DevTest?



  • 16.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 14, 2017 06:43 AM

    Pragati,

    Did Rick's recommendations help you out with this issue?



  • 17.  Re: Multiple response for a Single request in TCP/IP Service Virtualization in CA Communities

    Posted Sep 22, 2017 05:54 AM

    Not Yet Reid. Please give me your solution, if you have something.