Service Virtualization

  • 1.  Using url parameters in JDBC component

    Posted May 22, 2017 12:13 PM

    We are trying to virtualize a REST call in which we have to fetch the query and url parameters from the request.



  • 2.  Re: Using url parameters in JDBC component
    Best Answer

    Posted May 22, 2017 07:19 PM

    The HTTP_Segment_Attr_3 you are referring to is stored in a com.itko.util.ParameterList object inside the incoming request's MetaData.  One method of retrieving the value is to access it via a method call such as: lisa_vse_request.getMetaData().get("HTTP_Segment_Attr_3")

     

    Another, perhaps easier approach, is to include a REST DPH with a URI rule. The DPH will extract values from the URI and create arguments that show up in the VSI Argument list.  These argument keys will initially contain a value of URLPARAM unless you override the name and assign your own 'key' name.  If you apply the DPH, your URI will look something like this:  

    http://dtl01lsaap125:9090/advs-service-location/locations/sourcing/{URLPARAM0}/{URLPARAM1}?category=BESTBUY&&orderQty=1&los=1&considerFloor=false&count=3&orderDate=20170517T05:13:05

     

    The VSI Operation might look something like:   GET /advs-service-location/locations/{URLPARAM0}/{URLPARAM1}

     

    The VSI Argument key/value pair list might look something like:

    URLPARAM0 / 4980442

    URLPARAM1 / 55423

    category / BESTBUY

    orderQty / 1

    considerFloor / false

    count / 3

    orderDate / 20170517T05:13:05

     

     

    Using the REST DPH, your query should be able to contain the property {{request_URLPARAM0}}.  See if this documentation helps: REST Data Protocol Handler - DevTest Solutions - 10.0 - CA Technologies Documentation