Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Dynamic Data Element

lukeliwanag
lukeliwanag Posts: 36

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?

Comments

  • williammccusker
    williammccusker Posts: 642 ✭✭✭

    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!

  • lukeliwanag
    lukeliwanag Posts: 36

    Hi William,

    This helped a lot! thank you.