Rod Anderson
Member
I'm calling a rest service and getting back the below JSON. I tried to build a dynamic dataset but since the the JSON document omits the outer object I get errors 15358 and 15374 which I can't seem to find a work around.
I then tried picking the specific data I need using:
oObject = CAST(oEntity, JsonObject).
oNestObject1 = oObject:GetJsonObject(""). /* this should be the name of the outer object */
cRequestID = oNestObject1:GetJsonText('requestId').
But without the name of the outer object I can't grab the value(s). Any ideas as to how to resolve this?
Thanks in advance,
Rod
{
"requestId": "f9f471c9-4c3f-403a-86e7-aadae573350f",
"application": "XCDS",
"genDt": "",
"createDt": "2017-08-07T14:35:14.931-04:00",
"timeToLive": 60,
"runAfterDate": "",
"runAfterRequestId": null,
"fixId": null,
"fixOption": null,
"status": "Maintenance never sent",
"sent": false,
"_links": [{
"rel": "appList",
"uri": "http:\/\/smisdev.mydomain.com\/polling\/v1\/app\/XCDS",
"methods": [
"GET",
"POST",
"OPTIONS"
]
},
{
"rel": "operations",
"uri": "http:\/\/smisdev.mydomain.com\/polling\/v1\/f9f471c9-4c3f-403a-86e7-aadae573350f\/operations",
"methods": [
"GET",
"POST",
"DELETE",
"OPTIONS"
]
},
{
"rel": "self",
"uri": "http:\/\/smisdev.mydomain.com\/polling\/v1\/f9f471c9-4c3f-403a-86e7-aadae573350f",
"methods": [
"GET",
"POST",
"PUT",
"OPTIONS"
]
},
{
"rel": "stores",
"uri": "http:\/\/smisdev.mydomain.com\/polling\/v1\/f9f471c9-4c3f-403a-86e7-aadae573350f\/stores",
"methods": [
"GET",
"PUT",
"POST",
"DELETE",
"OPTIONS"
]
}
]
}
I then tried picking the specific data I need using:
oObject = CAST(oEntity, JsonObject).
oNestObject1 = oObject:GetJsonObject(""). /* this should be the name of the outer object */
cRequestID = oNestObject1:GetJsonText('requestId').
But without the name of the outer object I can't grab the value(s). Any ideas as to how to resolve this?
Thanks in advance,
Rod
{
"requestId": "f9f471c9-4c3f-403a-86e7-aadae573350f",
"application": "XCDS",
"genDt": "",
"createDt": "2017-08-07T14:35:14.931-04:00",
"timeToLive": 60,
"runAfterDate": "",
"runAfterRequestId": null,
"fixId": null,
"fixOption": null,
"status": "Maintenance never sent",
"sent": false,
"_links": [{
"rel": "appList",
"uri": "http:\/\/smisdev.mydomain.com\/polling\/v1\/app\/XCDS",
"methods": [
"GET",
"POST",
"OPTIONS"
]
},
{
"rel": "operations",
"uri": "http:\/\/smisdev.mydomain.com\/polling\/v1\/f9f471c9-4c3f-403a-86e7-aadae573350f\/operations",
"methods": [
"GET",
"POST",
"DELETE",
"OPTIONS"
]
},
{
"rel": "self",
"uri": "http:\/\/smisdev.mydomain.com\/polling\/v1\/f9f471c9-4c3f-403a-86e7-aadae573350f",
"methods": [
"GET",
"POST",
"PUT",
"OPTIONS"
]
},
{
"rel": "stores",
"uri": "http:\/\/smisdev.mydomain.com\/polling\/v1\/f9f471c9-4c3f-403a-86e7-aadae573350f\/stores",
"methods": [
"GET",
"PUT",
"POST",
"DELETE",
"OPTIONS"
]
}
]
}