NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ProperGary

Pages: 1 [2]
16
Web Server - Ask For Help / 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?


17
Web Server - Ask For Help / Complex Data in NetTalkAPI
« on: March 09, 2022, 03:35:04 AM »
Firstly, apologies for any incorrect terminology, I'm new to Clarion (very old to developing), I've been immersing myself in code articles and webinars but still gaps in my knowledge of Clarion  :)

I've created an API using NetTalk - I have authentication, JWT tokens and simple methods/endpoints all working, but now need to do some more complicated "product" and "order" methods/endpoints that require re-labelling of fields, handle data from a multiple tables and include many code->description looks ups.

I've coded the product query in a SQL query (stored as a Sybase SQL View), but I can't get Clarion to import that view whatever I try, it's may be because it has multiple lookups into the same "extended data" table with different filters to expand text fields (basically all long text fields are stored in a separate table, design not changeable).

So I am thinking that I need to use a GROUP or a QUEUE declared as a type, to pass the data in/out of the API ? Which would also give me more scope to validate the incoming data, add defaults etc. I thought about creating a class (I've used a class for token handling) so I could encapsulate the code, but it looks like NetTalk doesn't support Class as a parameter type?

I've seen that some people mirror the SQL view as a table in the dictionary, but that seems a little messy and I'm not sure how would the update validation would work? That maybe my lack of Clarion experience.

Could people point me toward the best solution for multi table endpoints? I did look for NetTalk examples or Webinars, but could not see anything matching the complexity we need.



18
Thanks Jane, will get a purchase approved!

19
Hi All,

I've been building an API server using NetTalk and have been asked by the clients infrastructure guys if the server can run as a Windows Service or ideally as an Azure App Service.

Can it be done? has anyone done this and can point me in the right direction?

Thanks in advance

Gary.

Pages: 1 [2]