Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 21061

REST Virtual Svc Response - parameterized variable not replaced in Response

$
0
0

I am using ServiceV Pro's "Sample Virtualization Project" (RESTMockService)

 

In the "GET Search" Action, the Dispatcher script calls the "Wildcard Response" response

if (searchstring == "all")

 

I go to the "Wildcard Response" and would like to return a custom value that is set to a variable

{
"id": "4",
"description": "${item4description}",
"price": "4"
},

 

I write a Response Script for "Wildcard Response" which does

def item4description = "My value from Response Script"

 

When  I start the Virtual Service and call the virtual service using

http://localhost:8089/search?searchstring=all

 

I get 

      {
        "id": "4",
        "description": "",
        "price": "4"
      },

 

Can someone please help and let me know why it is not substituting the value of the variable for json responses?

 

Thanks

Raghu

 

 


Viewing all articles
Browse latest Browse all 21061

Trending Articles