Hi, i have a query regarding deserialization JSON using X++, while working on this i am getting null response from request especially Response = Request.getResponse();
Hi, thank you for the explanation. I did the similar steps to deserialize my json response. I am facing an issue in getting the array data from ObjectContract class. Below is the json response received through Authentication API: { "status": "OK", "description": null, "contents": { "apiToken": "42c3bcf9-5259-4f35-90b3-400216e37308", "expirationDate": "2020-10-17 21:38:25.885" } } i am getting blank array data for "contents" when deserializing using FormJsonSerializer. The only difference i found in your json string is that you have "[" braces in the string. please suggest how this can be resolved !! Thanks
@@vaibhavbhat7058 you mean like that ? [DataMemberAttribute("sections"), DataCollectionAttribute(Types::Class, classStr(NAQLA_NKPSectionContract)), AifCollectionTypeAttribute('sections', Types::Class, classStr(NAQLA_NKPSectionContract)), AifCollectionTypeAttribute('return', Types::Class, classStr(NAQLA_NKPSectionContract))] public List parmSectionList(List _SectionList = SectionList) { SectionList = _SectionList; return SectionList; } ?
Hi,
i have a query regarding deserialization JSON using X++,
while working on this i am getting null response from request especially Response = Request.getResponse();
Hi, thank you for the explanation. I did the similar steps to deserialize my json response.
I am facing an issue in getting the array data from ObjectContract class.
Below is the json response received through Authentication API:
{
"status": "OK",
"description": null,
"contents": {
"apiToken": "42c3bcf9-5259-4f35-90b3-400216e37308",
"expirationDate": "2020-10-17 21:38:25.885"
}
}
i am getting blank array data for "contents" when deserializing using FormJsonSerializer.
The only difference i found in your json string is that you have "[" braces in the string.
please suggest how this can be resolved !!
Thanks
in that case , at outer level you should define the return type as a contract object instead of list.
@@vaibhavbhat7058 you mean like that ?
[DataMemberAttribute("sections"),
DataCollectionAttribute(Types::Class, classStr(NAQLA_NKPSectionContract)),
AifCollectionTypeAttribute('sections', Types::Class, classStr(NAQLA_NKPSectionContract)),
AifCollectionTypeAttribute('return', Types::Class, classStr(NAQLA_NKPSectionContract))]
public List parmSectionList(List _SectionList = SectionList)
{
SectionList = _SectionList;
return SectionList;
}
?
@@omarabdelhamed1056 can u show us how u solve this problem at last?
Hi.. how can we serialize and deserialize json on ax 2009?
con una dll en .net y la agregas como referencia.