Service Virtualization

  • 1.  VSI transaction Basepath and URLParam problems

    Posted Feb 16, 2017 09:11 AM

    version  9.1, we recorded a set of REST/JSON transactions, which contain an account number in the URL,

    we added the rest and json DPH's at the end of record, and the correct VSI transactions were created.

     

    then we use postman to test the service (running in ITR), and the original account number URL works,

    any other account number and we get a 404 error on return..

     

    in the Error case, the ITR never moves off the listen step. 

     

    we noticed the VSI transaction Basepath field contains the full URL with the ORIGINAL account number in it.

    anything else will be wrong. 

     

    if we shorten the basepath to just before the account number, then the service works. 

    what is wrong here? the vsi transaction parameters are correct, including URLPARM0,

    and its url string is /foo/bar/{URLPARM0}/test as expected. 

     

    changing the VSI transaction parm to magic string or comparison operator to 'anything' don't help. 



  • 2.  Re: VSI transaction Basepath and URLParam problems

    Posted Feb 16, 2017 09:37 AM

    and a secondary question 

     

    how could I debug this in ITR? it never progresses from the listen step...



  • 3.  Re: VSI transaction Basepath and URLParam problems

    Broadcom Employee
    Posted Feb 16, 2017 11:51 AM

    From the docs

     

    https://docops.ca.com/devtest-solutions/9-1/en/using/using-ca-service-virtualization/using-the-workstation-and-console-with-ca-service-virtualization/editing-a-vsm/virtual-http-s-listener-step

     

    • Base path
      Identify the HTTP requested resource URIs that the listen step is to process. When the request comes in, the list of queue names is scanned for a name (base path) that starts the URI on the request. The queue name that matches is the one into which the request is placed. The listen step that is associated with the queue (by base path) processes the request.

     

    As the ORIGINAL account number in present in Base path of the generated model - this works only with the original account number. You have correctly shortened the base path to service other account numbers



  • 4.  Re: VSI transaction Basepath and URLParam problems

    Posted Feb 16, 2017 12:29 PM

    thanks.. 

     

    >As the ORIGINAL account number in present in Base path of the generated model - this works only with the original account number. You have correctly shortened the base path to service other account numbers

     

    thanks,.. thats what we did, but.. if it could determine that this field in the url should be a URL Param (url in VSI transactions), why didn't it correct(shorten) the basepath? for us?



  • 5.  Re: VSI transaction Basepath and URLParam problems

    Broadcom Employee
    Posted Feb 16, 2017 01:30 PM

    I am not aware of the internal working - I have seen the base path as / for URI which has /foo/bar/{URLPARM0}/abc in Devtest 9.5 



  • 6.  Re: VSI transaction Basepath and URLParam problems
    Best Answer

    Posted Feb 17, 2017 10:33 AM

    ^ good question, Sam.  

    Perhaps, there is a bit a guess work involved, and in your case DevTest guessed in the wrong direction.  

    Conversely, I had a use case where we needed a property in the base path. For example:  /someTag/{{LANG}}/catalog.  

     

    The LANG property was defined in a config so that we could deploy multiple services to the same endpoint and separate out language (EN = English, SP = Spanish, GE = German, etc.).  

     

    The URI rule filtered the language part of the URI into a URLPARAM property so we could locate and respond with the appropriate language sensitive response text. (All responses were in a single VSI.)

     

    In our case, shortening the path to /someTag would have been too loose as one endpoint port was being listened on by approximately 30 different services each having a similar URI. 

    Examples of some of the base paths on the same endpoint were:

    /someTag/{{LANG}}/catalog/{URLPARAM1}

    /someTag/{{LANG}}/products/{URLPARAM1}

    /someTag/{{LANG}}/items{URLPARAM1}



  • 7.  Re: VSI transaction Basepath and URLParam problems

    Posted Feb 17, 2017 10:45 AM

    thanks.  you could have done this in one service too, by using different VSI files.. (and using that part of the URL as the filename identifier).. 

     

    but I understand..   for the uninformed of the quirks, this makes the 'easy' path not work..