Given the following HTTP response :
{"id":"1", "name":test"}
At the moment, when you check "see JSON requests/responses as xml content" in "Edition > Preferences > Project settings > Modules Manager > JSON" (in order to be able to use xpath instead of regexp), you have a completely useless stuff like :
<ObjectNode>
<__children>
<entry>
<string>id</string>
<__value>1</__value>
</entry>
etc...
Note : this is useless because when you have deep JSON response, you have XPath like : ArrayNode/__children/child::ObjectNode/__children/entry[child::string/text()='data']/ObjectNode/__children/entry[child::string/text()='id']/IntNode/__value
I have managed to create an extension where I parse the JSON inside a JSONObject or JSONArray and then I call
return "<root>"+XML.toString(json)+"</root>";
which gives me a beautifull
<root><id>1</id><name>test</name></root>
Note : that I could process easily with xpath
The problem is that then Neoload converts this to
<String><root><id>etc...
which is as useless as the first stuff (maybe more useless because XPath is not an option anymore as I only have one node).
So my question is how can I change the way Neoload is transforming my Decoder return value ?
I have tried to return JSONObject or JSONArray in the Decoder directly and then to use a Namer, but the Namer seems to be used only with requests, not with responses.
Any hint is appreciated !