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
1
Web Server - Ask For Help / Re: UTF8 coming in to API Server
« on: December 06, 2022, 10:00:11 AM »
Hi Bruce,

Thanks for your response, sorry to be so slow in replying, I was pulled onto other priorities!

We are moving the database away from Windows-1252, but that will be some time early(ish) next year, in the mean time we wanted to look at keeping the JSON encoding and either manually converting or storing as JSON and converting when displayed.

To that end, I added self.SetJsonDecode(FALSE) to the json | Construct() embed point of the NetWebServiceMethod, but the strings are still being decoded, should this be elsewhere?

Gary

2
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


3
Web Server - Ask For Help / Re: Queues within Queue incoming JSON
« on: October 06, 2022, 07:45:36 AM »
Answered live on NetTalk webinar 6th October 2022

4
Many thanks Jane & Bruce.

IT company have provided the PFK and also the .CRT and .KEY

The Key file is password protected - I just need them to give me the password and I'm good to go :)

Sorry, should have put in Original post - I'm using NetTalk 12.46

5
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

6
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

7
>> You've cunningly omitted to mention which build of NetTalk you are using, so I assume it's NetTalk 12.
Can't make it too easy for you Bruce :)   NetTalk 12.41 to be precise

>>My guess is that you haven't installed the VC runtime.
OK, so I had and I hadn't - I installed the 64 bit, coz it's a 64 bit OS - forgetting that Clarion is 32Bit (forgive me I'm new-ish) and so I needed to install the 32bit version.

Installed 32bit - now all working :)

Thanks





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


9
Web Server - Ask For Help / Re: Add to API auto documentation
« on: April 20, 2022, 06:35:39 AM »
Hi Bruce,

Happy to go through in next weeks webinar, my issue is that I can define a field of type Queue in a queue, but I don't see a way to tell it that the Queue is of type "shippingServices" so the documentation does not know what to show.

See images attached.

I've built this as a demo project, which I'll email you as attaching failed.

10
Web Server - Ask For Help / Re: Add to API auto documentation
« on: April 19, 2022, 05:48:52 AM »
Hi Bruce,

My problem is that I can't see how to define my data structure in the data pad
Code: [Select]
JSON data structure
"ShippingCodes": [
{
  ?code?: ?DHL?,
  ?description?: ?DHL Limited?,
  ?service?: [
    {
      ?code?: ?NEXTDAY?,
      ?type?: ?Next Day?
    }
    {
      ?code?: ?PRE1?,
      ?type?: ?Before 1pm?
    }
    {
      ?code?: ?SAS1?,
      ?type?: ?Slow and Steady?
    }
  ]
}
{
  ?code?: ?RM?,
  ?description?: ?Royal Mail?,
  ?service?: [
    {
      ?code?: ?FIRST?,
      ?type?: ?Standard First Class?
    }
    {
      ?code?: ?PRIORTY?,
      ?type?: ?Priority Next Day?
    }   
  ]
}
]

So I need a Queue referenced within a Queue, which I can't work out a way of doing in the data pad, although I can do it in code:

Code: [Select]
shippingCodesQueue  QUEUE,TYPE
code                         STRING(20) !Shipping Code
description                STRING(100) !Shipping Code Description
services          &serviceListType         !Related Services
END


!Service list Structure
serviceListType        QUEUE,TYPE
code                       STRING(20) !Shipping Service Code
description              STRING(100) !Shipping Service Description
END


Is there some trick or work around to define the above in the data pad?

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

12
Web Server - Ask For Help / Re: Second NetWebService in same WebServer
« on: March 30, 2022, 04:44:01 AM »
Spot on Bruce - many thanks, that has got it sorted.

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

14
Just an update on this...

Clarion 11 will not let you change the DCT if the memory driver is not installed, displays a dire warning and makes the DCT "read only".

So you'll need to edit the DCT in Clarion 10, which displays a similar warning, but lets you continue and then open in 11 afterwards.


15
Web Server - Ask For Help / Re: Format issue with XML return
« on: March 16, 2022, 05:24:31 AM »
Thanks Bruce - will keep an eye out for it :)

Pages: [1] 2