Service Virtualization

Expand all | Collapse all

Virtual Services for Create/Add Scenarios

Jump to Best Answer
  • 1.  Virtual Services for Create/Add Scenarios

    Posted 08-28-2020 10:55 AM
    Hi,

    Can someone help me on the below scenario?

    I have a REST API, which which generates account number for new users and have another API, which uses the generated account number to fetch the details of the account. How can we virtualize this scenario as realistic as possible, by using an excel or csv to store the generated account number for API-1 and fetch from the same file when the API-2 is called. 

    Example. API-1
    Request:
    POST /api/v1/customer/entry
    {
    "firstName" : "John",
    "lastName" : "Mathews"
    }

    Response:
    {
    "accountNumber" : 2020-1234567890,
    "msg" : "Account Created Successfully"
    }

    API-2
    Request:
    POST /api/v1/customer/fetch
    {
    "accountNumber" : 2020-1234567890
    }

    Response:
    {
    "firstName" : "John",
    "lastName" : "Mathews",
    "accountNumber" : 2020-1234567890
    }

    Thanks
    Senthil Manohar


  • 2.  RE: Virtual Services for Create/Add Scenarios

    Posted 08-28-2020 11:22 AM

    Hi,

     

    DevTest offers the SharedModelMap if you want to exchange data between Virtual Services.

     

    If you search the communities threads you'll find some example of how it can be used.

     

    Cheers,

    Danny

     

    ::DISCLAIMER::

    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.






  • 3.  RE: Virtual Services for Create/Add Scenarios
    Best Answer

    Posted 08-28-2020 01:15 PM
    Hi Senthil,

    For a simplistic approach, you can save the accountnumber of API-1 call in a text file and use the same text file for retrieval in next API.

    To Cater more complex scenarios, i would recommend using DB instead of Excel & CSV.

    Thanks

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



  • 4.  RE: Virtual Services for Create/Add Scenarios

    Posted 09-18-2020 09:24 AM
    Thanks Vaibhav... do you have any sample mar? it would of great help

    ------------------------------
    Senior Consultant
    Atos
    ------------------------------



  • 5.  RE: Virtual Services for Create/Add Scenarios

    Posted 09-21-2020 12:11 PM
    Hi Senthil,

    Unfortunately, nothing readily available for sharing.

    Thanks.

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