I am using the latest release of LoadRunner 12 and the HP Virtual Table Server. We have the VTS configured and working. I am able to successfully create LR scripts that read and write to/from the VTS using the LR functions.
Now I am trying to build a JAVA client outside of VUGen. I configured access to the API as per instructions in the HP document guide:
VTS3_Communication_Specification_v1.0.docx
When I send a command through the API I can only get back one response:
{"data":null,"status":{"error":"Unexpected token u","code":-20201}}
No matter what I send I get that back from the VTS server. I can see that this is a response from the VTS server and it is formatted in JSON, but this is obviously an incorrect response since returning index:1 should return the first row of data from the VTS (and yes, there is data there. I can see it from the VTS GUI).
I also created a LR WEB Custom Request formatted to send JSON commands directly to the VTS API. Based on everything I read in HP documentation this should be working. Does anyone know what I'm missing here? Is there some additional setup on the server I need to set to allow access to the API or some kind of additional header?
Any help would be appreciated.
web_custom_request("VTS_Command",
"URL=http://localvtsserver:8888/api",
"Method=POST",
"Resource=0",
"EncType=application/json",
"Body={\"cmd\": \"get\","
"\"version\": \"1.0\","
"\"data\": "
"{\"index\": 1}"
"}",
LAST);
This is all I see in the VTS log output each time I get that error:
{"level":"info","timestamp":"2015-02-23T19:19:23.383Z","message":"return: {\"data\":null,\"status\":{\"error\":\"Unexpected token u\",\"code\":-20201}}"}