D365 Finance and Operations/AX7 Tutorial: Deserializing JSON Using X++

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 8

  • @subbaraovv
    @subbaraovv 6 месяцев назад

    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();

  • @arunkhanna88
    @arunkhanna88 4 года назад +1

    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
      @vaibhavbhat7058 Год назад +2

      in that case , at outer level you should define the return type as a contract object instead of list.

    • @omarabdelhamed1056
      @omarabdelhamed1056 Год назад

      @@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;
      }
      ?

    • @lewists9475
      @lewists9475 4 месяца назад

      @@omarabdelhamed1056 can u show us how u solve this problem at last?

  • @kishorjadhav2615
    @kishorjadhav2615 3 года назад

    Hi.. how can we serialize and deserialize json on ax 2009?

    • @carlos-qs2zs
      @carlos-qs2zs 3 года назад +2

      con una dll en .net y la agregas como referencia.