Service Virtualization

Expand all | Collapse all

Dynamic response for job number in VS

Jump to Best Answer
  • 1.  Dynamic response for job number in VS

    Posted 08-03-2020 03:43 AM
    Hi all,

    one of the use case scenarios , the request sends information (seg# , subseg# , plant id etc) from web application through Odata service / HTTPS request to SAP system and which will generate the job number to that request. This job # which is generated in SAP has a logic to it. It will always generate a unique # and follows a patter like J.20.xxxxxx. 
    how will this behaviour be captured in the virtual service. The VS cannot generate unique # and it will not know what is the next in the series of the job #'s. could you please let know how to handle this situation. Can we say we can allow the VS to respond similar to J.20.xxxxxxx where xxxxxx can be any random no or any other solution that can be used to let the teams know. also kindly provide what are the implications of solution in terms of getting the dynamic response.
    All your inputs will be appreciated.
    Thanks
    Anil​​​​


  • 2.  RE: Dynamic response for job number in VS
    Best Answer

    Posted 08-03-2020 05:50 AM
    Hi Anil,

    Is the max value of jobID could be retrieved by an API call (or something similar)?

    Once you have the max value of the available ID, you can increment the same and use it for your virtual service transaction. 

    Thanks

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



  • 3.  RE: Dynamic response for job number in VS

    Posted 08-28-2020 10:55 AM
    Hi Vaibhav, can you please help me understand this solution in detail.

    What i understand is, if we have an api, which can fetch the max value, we can get the max value from the response and store it in a property and increment it by 1 before serving the actual req. Correct me if I am wrong


  • 4.  RE: Dynamic response for job number in VS

    Posted 08-28-2020 01:06 PM
    Yes Senthil, your understanding is correct.

    But this approach will work if your api responds with an incremented value everytime.

    Thanks.

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



  • 5.  RE: Dynamic response for job number in VS

    Posted 08-09-2020 03:07 AM
    Hi Anil,
    If xxxxxx follows some pattern, then try to identify that pattern and apply logic accordingly(i.e. increment) else you can apply regex [dddddd] which will generate random number everytime.

    Regards
    Sonali