AnsweredAssumed Answered

Argument to Property

Question asked by prejo12 Employee on Feb 5, 2015
Latest reply on Jul 23, 2015 by sdetweil2

Hi all.

 

How does one convert an argument from a request coming in to a Virtual Service (e.g. itemCode = 1) to a property?

 

The requirement is that a Virtual Service must bring back dynamic content from a database.

 

I have added a MySQL dataset on the VS Image Response Selection step in my VSM with a SQL statement "select * from items where id = {{itemCode}};" - I then get an error message stating that the data set references properties that are not valid for use in a data set.

I have tried using the Generic XML Payload Parser to set a new Attribute, Argument, and Meta Data field, but none of them can be used in the SQL Statement (same error). The built in properties seem to work though

 

I have also tried adding a filter to the VS Image Response Selection (Utility >>> Parse Property Value as Argument String), but that does not seem to store the argument as a property as described by the pop-up help.

 

Any thoughts would be greatly appreciated.

 

Kind regards,

Johan

 

P.s. We have highlighted that it might not be optimal to connect to a DB for the responses as this is introducing a new dependency into the environment, but the client is adamant that they want to see how this works.

Outcomes