Service Virtualization

  • 1.  RESTFUl API virtualization using RR Pair

    Posted Sep 08, 2017 06:59 AM

    Hi All,

     

    Greetings for the day.

     

    Am new to RESTFUl API. I have a requirement where i need to virtualize Restful API.

    I have request URL and response Json file.

    My Request URL is as follows

    Sample URL: http://pgeshe-ee.dtveng.com/pgws/content?etoken=37nB85IzmCjNsJH%2BuWWTr8CofonIkKwN9eEHkyMgbKzotE%2F9SvAhE%2FCfx8Bqc9HV4M9yWOQVHQBKQkVTn02acjlDDrD4mtEkNQinGd7utlmfXjbXOe03pXbdAaaSvvCwfQSI79gayA56N0SzhOnzqm2rHbAwMhrJ9qj5XOXAhCUkibmbvwHlC25kkNhg1e3gThduJ%2B3S6Uu1sfBVdZpqoS%2B4wjQLOMTUZjqRwzXha4fCtPgIVZyw7ogddZLlTgRzmWbYF50A3bwBSydvYQHJzRW2dXV4nbbPgwCjBYYW8BiYWi4%2BlEJg4zn3miB7CArl3syIjzRyzAAOqPmKGhKDJSvLouKdas22qNmUdsIY1MlKgylA7ZH7Wg%2FZhtGtjEFZjQaRdpv1jIVVyVM8aZlEiddUUszjWbgaxvbZiV97fBc%3D%0D%0A&includepurchaseoffer=EST&siteid=DTVIT_C01&siteuserid=qay.71903466%40directv.com&signature=xNSEYJxIPNqHU%2FLBfv2rkYjX0K6vSihi&materialid=B200029163M3

     

    In the URL the materialid is a value which will change in the calls.

    Even after simulation also the URL must be the same by changing the hostname and port number.

    When i virtualize , the URI coming something like this.

    http://hostname:port/pgws/content/

     

    I dont want like this, i want which is similar to actual URL.

    when i hit with query parameters, its not hitting the service.

     

    Please suggest me what changes i have to do.

     

    Thanks,

    Girija K.



  • 2.  Re: RESTFUl API virtualization using RR Pair
    Best Answer

    Broadcom Employee
    Posted Sep 08, 2017 10:10 AM

    Hello,

                If you are referring to the operation name as URI, the url parameters get set as arguments in the image file as enclosed. The base path is set in the listen step of model file as enclosed, which contains the entire url basepath (if this is the only operation you are virtualizing). If there are other operations with different url parameters in the uri, then the base path will not have the entire url, but only what is common between operations. 

     

    Thanks,

     



  • 3.  Re: RESTFUl API virtualization using RR Pair

    Posted Sep 19, 2017 05:39 AM

    Hi Surya,

     

    Thanks for the response.

    Yeah it worked for me.

     

    Regards,

    Girija K.



  • 4.  Re: RESTFUl API virtualization using RR Pair

    Posted Sep 08, 2017 11:45 AM

    Girija,

     

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



  • 5.  Re: RESTFUl API virtualization using RR Pair

    Broadcom Employee
    Posted Sep 14, 2017 10:26 AM

    As Surya said, all the query string parameters in the URL are recorded as Request Data Arguments in the VSI. You can change the host name and port and leave the remaining URL as is during playback and that should work.

     

    If you want "materialid" to be any value then you can change the "Comparison operator" to be "Anything" for "materialid" in the VSI.



  • 6.  Re: RESTFUl API virtualization using RR Pair

    Posted Sep 19, 2017 05:39 AM

    Thank you Prema.