When we tried to parse arguments using JSON Data Protocol the arguments extracted differs in the VSI from 8.x to 10.x
For example: See Sample Json,
"cars":[ "Ford", "BMW", "Fiat" ]
The Arguments in the VSI is shown as below for 8.x and 10.x:
Why the difference and how to fix this?
We have changed the way we parse JSON arguments in DevTest version 9.5.1 or newer.
DevTest 8.x uses JSON v1 DPH and and DevTest9.5.x or newer uses JSON v2 DPH.
In JSON v1 DPH , we transparently convert the JSON to XML before storing it in the VSI; this would then be converted back to JSON when issuing a response. When the JSON v1 DPH would parse the request arguments from an array in the internal XML, it used the “arrayName_element_X” key template, where arrayName is the name of the array (in this case “cars”), and X is the index of the element starting at 0.
The newer JSON v2 DPH, by contrast, keeps the JSON from the request as-is and doesn’t convert it to any different format. When it parses request arguments from the incoming JSON, it walks the JSON structure and when it finds an array, it uses the “arrayName_x” key template, where arrayName is the name of the array (in this case “cars”) and X is the index of the element in the array starting at 0.
DevTest 8.x and DevTest 9.5.x or newer