Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How can we parameterize a dynamic URL parameter (not q Parameter)

Options
sdas88
sdas88 Posts: 1

Here is the path:
/eosservices/SOHServices/api/v1/group/SOH/customers/id (dynamic value)/locations?q=customerNumberTypeCode==CDF;statementofHealthReportingLocationID==86A&limit=2

I want to parameterize the "ID" parameter which is going to be dynamic and unique.. i should be able to read the dynamic value from the incoming request and map it with data source, if the incoming value matches with the data source it should provide the response as mocked up..

Answers

  • williammccusker
    williammccusker Posts: 643 ✭✭✭
    Options

    Hi,

    I can think of two ways that a path parameter might be extracted. The first is to use the REST URL Data Bank to extract the entire path segment. This would get the value "id (dynamic value)" which would include the parameter name. You could use the entire path segment as part of the data source lookup.

    See REST URL Data Bank tool documentation for more details
    https://docs.parasoft.com/display/SOAVIRT9103/REST+URL+Data+Bank

    If that doesn't work and you have to have only the value part then you will need to use a custom correlation to extract the value using a script. Since there is no standard format for how path parameters are delimited there isn't built-in support for extracting values from them. The default script has an example of how to get the request URL path as a string so from that you could write a script to parse the parameter.

    See custom correlation documentation, search for "Custom Correlation"
    https://docs.parasoft.com/display/VIRT9106/Message+Responder+Overview#MessageResponderOverview-DataSourceCorrelationTab