Service Virtualization

Expand all | Collapse all

REST full service parametrization

Jump to Best Answer
  • 1.  REST full service parametrization

    Posted 02-20-2017 08:34 AM

    I am trying to parameterize the argment in rest uri, but i am getting  no match found. i am using get method and using REST data protocol. 

    Operation: GET /address/{zip}

    endpoint: http://localhost:8081/address/?zip=123 

     

    please help me to solve this



  • 2.  Re: REST full service parametrization
    Best Answer

    Posted 02-21-2017 07:52 AM

    You seem to be mixing the concepts of URI rule processing and query string handling.  

     

    URI rules are used to parameterize the URI.  For example, 'GET /address/{zip}' is looking to parameterize a value that is coming in the URI such as 'GET /address/123'.

     

    Your example endpoint is sending a query string.  For example, http://localhost:8081/address/?zip=123  In other words, your URI is GET /address not GET/address/{zip} in the preceding example. 

     

    OOTB, DevTest parses query string parameters into request arguments.  This is why you see the property request_zip = 123 in your picture.

     

    The URI rule /address/{zip} is looking for a URI containing "address/123" so that the value '123' is parameterized. 

     

    If for some reason you wanted a URI rule (/address/{zip}) to parse a zip and a query string, you would send:

    'GET /address/75166?zip=123'  Personally, I would use a URI property name other than 'zip' if a query string value could also have the same name.



  • 3.  Re: REST full service parametrization

    Posted 02-22-2017 02:32 PM

    Venkata,

     

    Did Joel's recommendations help you out?

     

    Regards,

    Reid