Is it possible to load the message below into a progress dataset?
/* ------------------------------------------------------------ */
{
"Message": {
"Id": "id-0",
"Company": "NR",
"Prodnr": {
"Beskrivelse": "OH medarbeider",
"Koststed": {
"Beskrivelse": "SDKP Kompetanse",
"Id": 8131
},
"Sendear": 2018,
"Gyldighet": {
"StartPeriode": 201609,
"SluttPeriode": 209912
},
"Id": "APUS110166",
"Operation": "UPDATE",
"Lokasjon": 700,
"Sperret": false
}
}
}
No, it is not possible for the JSON string above to be deserialized into a dataset. In the OpenEdge ABL, a dataset is serialized as a JSON object, containing a sequence of JSON arrays representing the member temp-tables. Each temp-table JSON array consist of a sequence of JSON objects containing field data for each row.
{"myDataset:{
"myTT1":[
{row1 field values},
{row2 field values},
..
],
"myTT2":[
...
]
}
}
No, it is not possible for the JSON string above to be deserialized into a dataset. In the OpenEdge ABL, a dataset is serialized as a JSON object, containing a sequence of JSON arrays representing the member temp-tables. Each temp-table JSON array consist of a sequence of JSON objects containing field data for each row.
{"myDataset:{
"myTT1":[
{row1 field values},
{row2 field values},
..
],
"myTT2":[
...
]
}
}
You can maybe write method to modify the JsonObject to something that matches DataSet load format!
To get a sample of what to match, write dataset with data to Json ;)
Work with the ObjectModelParser !
/* cast request to json object, request = your message */
myParser = new Progress.Json.ObjectModel.ObjectModelParser().
objJSON = cast(myParser:Parse(ipcRequest), Progress.Json.ObjectModel.JsonObject).
use GetCharacter, GetInt, GetArray to do your thing !
e.g.
vcTechnieker = objJSON:GetCharacter("technieker":u) no-error.