Dynamic Data Element
in Virtualize
Hi Everyone,
We're building a new service and one of the requirement for this is to have a dynamic Data Element
request looks like this:
{
"ClientDetails": {
"ECIF2314718598": {
"Address": {
"PostalAddress": {
"PostalCode": "R6W 1H7",
"City": "WINKLER",
"Province": "MB"
}
}
}
}
}
response should look like this:
{
"AdjResult": {
"pyCategory": "C",
"pyID": "202006230000012725",
"ClientDetails": {
"ECIF2314718598": {
"RiskLvl": 105,
"RiskCIF": "N",
"AppDebtIncomeRatio": "2",
"TotalMultipleLiability": 16600.00,
"CardRegion": 3
}
}
}
}
The bolded items per payload are always changing. pretty much that's the primary key being passed from the request. is there a way to do this in Parasoft virtualize 9.10?
0
Comments
Hi,
Is the desire to extract the dynamic field name from the incoming request and then use that same dynamic name in the response?
In that case, you could start with a JSON data bank and use an XPath like the following, local-name(/root/ClientDetails[1]/*[1]), to get the name of the field. For the response, you will have to set it into Literal mode and then use ${} to parameterize the field name.
Let me know if that helped!
Hi William,
This helped a lot! thank you.