NetTalk Central

Author Topic: Format issue with XML return  (Read 1325 times)

ProperGary

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Format issue with XML return
« on: March 15, 2022, 03:41:34 AM »
I have an API that is returning product information, the product information is a queue and it has three child queues.

When I request the data returned in JSON the data formats correctly:
Code: [Select]
{
    "response": {
        "product": [
            {
                "productid": 1,
                "title": "test2",
                "explicitlyrics": "",
                "marketinginfo": "",
                "tracklist": [
                    {
                        "diskno": 1,
                        "sideno": 1,
                        "trackno": 0,
                        "trackname": "Mr Right Side",
                        "duration": 0,
                        "isrc": "",
                        "contributors": "",
                        "lastmodified": 0
                    }
                ],
                "videolinks": [
                    {
                        "linkurl": "https:\\\\mytest.com\\videohere.mp3"
                    }
                ],
                "artworklinks": [
                    {
                        "linkurl": "https:\\\\mytest.com\\artwork1.jpg"
                    },
                    {
                        "linkurl": "https:\\\\mytest.com\\artwork2.png"
                    }
                ]
            }
        ],
        "skippedrecords": "0",
        "resultcomplete": "1",
    }

However when I request application/xml the child queues do not format correctly:

Code: [Select]
<?xml version="1.0"  encoding="utf-8"?>
<response xmlns="ProperAPI">
    <product>
        <productid>1</productid>
        <title>test2</title>
        <explicitlyrics/>
        <marketinginfo/>
        <tracklist>???</tracklist>
        <videolinks>???</videolinks>
        <artworklinks>
Any ideas what I can look at / change?


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11171
    • View Profile
Re: Format issue with XML return
« Reply #1 on: March 15, 2022, 09:48:20 PM »
There's not much you can change for now - I'm working on an update to xFiles that brings it into line with jFiles.
Clients can use Json in the meantime...

ProperGary

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Re: Format issue with XML return
« Reply #2 on: March 16, 2022, 05:24:31 AM »
Thanks Bruce - will keep an eye out for it :)