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.


Topics - ProperGary

Pages: [1]
1
Web Server - Ask For Help / UTF8 coming in to API Server
« on: November 23, 2022, 06:49:10 AM »
Hi All,

I have an API server that is receiving UTF8 data and putting it into a queue, I have NetTalk (Server version 12.49) set to save as Windows-1252 (see attached image)

My issue is that strings are not getting converted and if I try and do manually that does not work either (I changed NetTalk back to Save as UTF8, before trying) :
Code: [Select]
stSave=incomingQueue.fulltitle
iAnsiLen=LEN(CLIP(stSave))
incomingQueue.fulltitle=str.Utf8ToAnsi(incomingQueue.fulltitle,iAnsiLen,st:CP_WINDOWS_1252)
and
Code: [Select]
     str.SetValue(incomingQueue.fulltitle,TRUE)
     str.ToAnsi(st:EncodeUtf8,st:CP_WINDOWS_1252)
     str.GetValue()

StringTheory version 3.53

The String in JSON sent from Postman looked like this:
Code: [Select]
"fulltitle":"A1. Haremlik / A2. Istanbul / A3. Kar\u0131\u015Ft\u0131rma Kuklal\u0131\u011F\u0131n\u0131n \u0130plerini / A4. Hayda Bre / B1. Otoban / B2. Ich Bin Ein Auslander / B3. Arabesk",
In Clarion I get
Code: [Select]
A1. Haremlik / A2. Istanbul / A3. Kar??t?rma Kuklal???n?n ?plerini / A4. Hayda Bre / B1. Otoban / B2. Ich Bin Ein Auslander / B3. Arabesk
Any suggestions as to how I can convert / resolve?

Gary


2
I have my NetTalk API server installed have used the certificates process to successfully obtain the LetsEncrypt certificate.

The client has a wildcard CA certificate for the domain and wants the LetsEncrypt certificate swapped out for the CA verifiable certificate, can anyone advise how this can be done? or point me to instructions? I have looked on the NetTalk documentation but could not locate instructions on how to do this.

Thanks

Gary

3
Web Server - Ask For Help / Queues within Queue incoming JSON
« on: September 28, 2022, 06:02:27 AM »

My incoming JSON has a queues within a queue, I've created the queue reference in my queue and now need to "NEW" the queue in the NetTalk jFiles object, the jFiles example is

Code: [Select]
json.NewPointer          Procedure(String pColumnName)
  ! note that pColumnName is the json tag name, not the label. case sensitive.
  Code
  Case pColumnName
  Of 'contributorlist'
    products.contributorlist &= NEW contributorlistQueueType
  Of 'tracklist'
    products.tracklist &= NEW tracklistQueueType
  End

However, I'm unclear where I can access the embed point for this in NetTalk, can anyone point me in the right direction?

Thanks

Gary

4
I have a NetTalk API Server, it works on my Windows 10 dev machine and I deployed it to a test VM (Windows 10) and that also worked.

The UAT server is an Azure Windows 2019 Server, and I have what I assume is a deployment issue as I can't get my call to NetMakeHMAC to return a result.

My code is:
Code: [Select]
str.SetValue(CLIP(self.TokenHeader) & '.' & CLIP(self.TokenPayload))
str.SetValue(NetMakeHMAC(str.GetValuePtr(),str.Length(),self.APIClientSecret,net:CALG_SHA_256))    ! <-- This returns empty string in UAT machine
str.Base64Encode(st:NoWrap+st:URLSafe+st:NoPadding)
self.TokenSignature=str.GetValue()

I've checked that all my properties have correct values and I've tested all the values being passed to NetMakeHMAC.
I've also checked that CLANET.DLL, CLARUN.DLL, CLADOS.DLL All match my dev machine and OpenSSL.exe, Msvcr120.dll, Ssleay32.dll, Libssl32.dll and Libeay32.dll are in the EXE folder

I've also used an installer to install OpenSSL (recommendation found elsewhere) and running OpenSSL.exe does not display any errors.

But no matter what I do, NetMakeHMAC returns an empty string on the UAT machine but works on my dev.

Any suggestions? ideas? has anyone seen similar issue?

Gary.


5
Web Server - Ask For Help / Add to API auto documentation
« on: April 04, 2022, 03:45:47 AM »
My API returns a queue, but the queue in Local Data is defined using a Base Type that is defined in a separate class file.

The Auto Documentation therefore only picks up the Queue name and Description, the individual queue columns with their names, type and description don't get included.

Is there an embed point where I can manually add column details to the documentation or a way to get the documentation to look to the class definition?

6
Web Server - Ask For Help / Second NetWebService in same WebServer
« on: March 24, 2022, 05:33:19 AM »
I have an API server configured and all working well, I want to add a second "service" to the same server - I want to separate all the lookup data into a separate service to retrieve codes/descriptions and keep separate from the main entity API.

I added a second NetWebService procedure to the application and added a single NetWebServiceMethod which is assigned to it.

My issue is that the seconds service does not appear in the services drop down in the documentation, I can get to it if I use the direct URL localhost/servicename?servicemethodname but not from the landing page.

I've clearly missed a step or an association somewhere, but can't find it.

Can anyone assist?

7
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?


8
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.



9
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]