Service Virtualization

Expand all | Collapse all

Set the file name as operation name from RR pairs

Jump to Best Answer
  • 1.  Set the file name as operation name from RR pairs

    Posted 02-05-2019 06:23 AM

    Hi SupportListeners,

     

    I have a requirement where we need to create the virtual services using rr pairs and these need to be compatible during merging with the virtual services created using recording.The challenge I have is ,the rrpairs usually contain fixed length ASCII strings which are mainframe transactions and when creating the virtual service, I use copybooks to slice and dice the msg and usually keep the msg length as the operation name which is unique for each transaction.

     

    However, when creating the vs using recording , I get the transaction name in the meta which I can set as an operation name. This makes the vs created using rrpairs not compatible for merging with the vs created using recording.

     

    What I'm thinking is , if there is a possibility to read the rrpair file name which creating the virtual service, I can keep the transaction Name as the file name for the rrpairs and can keep that as an operation name while creating the virtual service which makes the Virtual service compatible for merging with Virtual service created using recording.

     

    Having said, could you please suggest if there is any way I can get the file name while creating the virtual service using rrpairs?  or if there is any other way, please do suggest .

     

    Thanks in advance!!

     

    Regards,

    Shivakumar.



  • 2.  Re: Set the file name as operation name from RR pairs

    Posted 02-08-2019 03:50 PM

    I would say that using a message length as the operation name is not a best practice.

     

    How are you setting the operation in the original service? Are you unable to use that same pattern?

     

    I suppose you could add a Scriptable DPH during RR Pair recording. The DPH takes the length of the lisa_vse_request body and sets it in the lisa_vse_request operation.

    int len = lisa_vse_request.getBodyAsString().length();

    lisa_vse_request.setOperation( Integer.toString( len ) );

    Would this create the operation match you want?



  • 3.  Re: Set the file name as operation name from RR pairs
    Best Answer

    Posted 02-09-2019 03:53 AM

    Have a look at the section "Sidecar Files" in the documentation Request/Response Pairs - DevTest Solutions - 10.3 - CA Technologies Documentation 

     

    You maintain a third file with each request response file and in that third file you add the meta properties you expect for your request. In your case the transaction name. Using a sidecar file you can (if needed) get a request object from a req-rsp pair that is completely similar to a request object obtained from a recording. That means that you can use exactly the same sequence of DPHs, configured in exactly the same way, and your 2 VSIs will merge without problems (I hope :-) ).

     

    Cheers,

    Danny



  • 4.  Re: Set the file name as operation name from RR pairs

    Posted 02-21-2019 05:41 PM

    Thanks a lot Danny. This is exactly what I'm looking for.

     

    Let me try that option.

     

    Regards,

    Shivakumar