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

Pages: [1] 2 3 ... 6
1
Web Server - Ask For Help / Re: Webhooks in Nettalk?
« on: September 08, 2026, 12:45:19 AM »
Hi all,

the thing is: what is good practice? For example I see the following implementations of the HMAC string to validate:

- messageId.timestamp.body (looks most sensible to me ...)
- timestamp.body
- variants without dots ...

Even how the labels of the http-headers are constructed seem to vary ("webhook-timestamp" seems most common)

I was hoping Nettalk maybe had this already under the hood.

B.t.w. currently out of office and running to the shop buying Cryptonite ...

Regards,
Ton


2
Web Server - Ask For Help / Small and fast response
« on: September 07, 2026, 10:02:20 AM »
Hi All,

I want my api-server to respond in the fastest way possible for some http (4xx) errors. Just a minimal header and no body at all.

I've looked p_Web.SendError(), but it always includes .html in the response body.

What's the way to construct a minimal response?

TIA,
Ton

3
Web Server - Ask For Help / Re: Webhooks in Nettalk?
« on: September 07, 2026, 09:59:50 AM »
Do  you have HMAC validation in place?

I don't have to interface with a relatively '"standard" provider, but I'm trying to design a webhook system so relatively small B2B partners have to follow "my" standard, that's why I want to setup it properly in advance ...

4
Web Server - Ask For Help / Webhooks in Nettalk?
« on: September 07, 2026, 01:31:03 AM »
Hi All,

I'm about to add webhook functionality to my api-server (so I'm the consumer in this case).

- is there any functionality already in place with Nettalk (14), maybe some examples in the example apps?
- is it good practice to implement HMAC validation and can I do this with Nettalk?
- is there any standard that is actual standard (I see quite different implementations all over the place ...)?

TIA,

regards,
Ton

5
Additionally:

- turns out the production server had a much smaller payload returned than was in my mind (roughly 1/10th of the heavily tested payload), there was actually a 2/3 second delay too when the non-compacted json was to be displayed.
- I measure the duration of the whole process and this included the ?SomeControl{PROP:Text} statement too, that was a little misleading too (and made netwebclient suspect)

I guess text controls (at least in c10) really like linefeeds in the data to be displayed ...

Sorry for the inconvenience

6
FOUND IT !

(It's NOT Nettalk !)

In net.pagereceived I've got this code:

  ?SomeControl{PROP:Text} = SELF.ThisPage.GetValue()

For some reason this thing goes haywire when I throw compacted json against it ... It also is not the "SELF.ThisPage.Getvalue()" itself, it's the assignment to the control ... have to dive into this a little deeper


7
I forgot to include the request headers:

Full http header for slow request/response (compact json):

GET /wsPurchases/ordersCoils HTTP/1.1
Accept: application/json
Accept-Language: en
Authorization: yadayada
Accept-Encoding: gzip
User-Agent: NetTalk 14.38
Host: 127.0.0.1:8091
Content-Length: 0
Connection: Keep-Alive

Full http header for fast request/response (human readable json)

GET /wsPurchases/ordersCoils?&readable=1 HTTP/1.1
Accept: application/json
Accept-Language: en
Authorization: yadayada
Accept-Encoding: gzip
User-Agent: NetTalk 14.38
Host: 127.0.0.1:8091
Content-Length: 0
Connection: Keep-Alive

(edit 27th aug ... also noticed the log files were not present)

8
HI all,

(using nettalk 14.38 for both server/client, clarion 10)

I ran into a strange but a little concerning issue:

all my endpoints have the option to request for human readable (non-compact) json or json without these spaces/line breaks (compact). I control this via parameter "readable=1" and use the human readable mostly only during testing. This in itself works ok.

Today I (by accident) I ran a GET with the option omitted, so effectively asking for "compact" json against a somewhat larger result/response and this took ages (cpu of het client app hitting the max)

- Human readable response takes 3 seconds
- Non-human readable json (so effectively less data) takes 90 seconds!

If tested all my endpoints and even small results take double time (when compacted) (40 ms process time becomes 80 ms), but the larger the response, the time to process the response seems to explode somehow.

Now the strange observations:

- I've tried both requests with Curl and both response are shown in somewhat the same time (roughly 3 seconds), to be complete this is the Curl command (with parameter active):
   curl --header "Accept: application/json" --compressed --header "Accept-Language: en" --header "Authorization: yadayada" --header "Connection: Keep-Alive" --user-agent "NetTalk 14.38" "https://127.0.0.1:8091/wsPurchases/ordersCoils?&readable=1"

- I've tried another set of requests against a nettalk 12.45 (production) server and then I see no (???!!?) difference (so it's not only the client?)

I (no evidence) suspect compression might be at play here. So I also tried net.AcceptEncoding = 'plain' and net.AcceptEncoding = '', but this doesn't make any differenct (compact stays way slower).

Below are both (nettalk client) headers to be complete and I've attached two log files (one slow and one fast) that show the difference. And a screenshot where the difference occurs.

Problem is there no more data between the delay in the log file ...

I'm a little clueless about where to start searching now and/or what settings might influence this slowdown.

Any tips are most appreciated

Thanks in advance

Regards,
Ton

9
Web Server - Ask For Help / Re: netwebclient : IPv6 addresses and port
« on: August 25, 2026, 04:10:10 AM »
Hi Bruce,

thanks a million

(great products and even better support!)

10
Hi All,

by accident I discovered that sometimes in the Webserver procedure, the following code (generated in legacy in: "before closing window"), has the following order

      s_web.iSession.Save()
    ThisWebserver.Kill()                              ! Generated by NetTalk Extension

but sometimes these lines are generated like this:

    ThisWebserver.Kill()                              ! Generated by NetTalk Extension
      s_web.iSession.Save()

I really don't know wether this is a problem or not (I didn't notice anything weird ...), but I think that for legacy this is cause by the following template code snippets that use the same priority() (see "nettalk.tpl"):

#AT(%BeforeWindowClosing),Priority(4500)
  #If((%NoNetTalk=0) and (%NoThisObj=0) and (%Family='cw20'))
%ThisObjectName.Kill()                      ! Generated by NetTalk Extension
  #EndIf
#ENDAT

#AT(%BeforeWindowClosing),Priority(4500)
  #If(%NoNetTalk=0 and %NoThisObj=0 and (%ABCBaseClass='NetWebServer' or sub(%ABCBaseClass,1,13)='NetWebServer_') and %Family='cw20')
    #IF(%FirstWebServer=%ActiveTemplateInstance)
#Insert(%ServerStateKillStuff)
    #endIf
  #EndIf
#ENDAT

Regards,
Ton

11
Web Server - Ask For Help / Re: netwebclient : IPv6 addresses and port
« on: August 19, 2026, 11:46:45 PM »
Hi Bruce,

hmm ...

I tried the brackets around het ::1 part, but then the "server" becomes "[" (which is expected with current Stringtheory code as far as I can tell as there is no code that accounts for the brackets per se and it looks for the ":" from left to right).

Both "::1:port" and "[::1]:port" don't seem to work.

I've attached a screenshot of some debugview (in yellow the original request and the server part netwebclient resolves to)

Am I missing something still?

Regards,
Ton

12
Web Server - Ask For Help / Re: How to translate C# API call to NT
« on: July 25, 2026, 07:54:37 AM »
Hi Ron,

dit this code actually run? As far as I know you cannot get a .POST to return the result right away ...

@Bruce: is this doable: adding a result (stringtheory object) and then somewhere set a ref to this result an automatically fill it when a response is received?

That would result i much cleaner code (and less work ...)

13
Web Server - Ask For Help / netwebclient : IPv6 addresses and port
« on: July 25, 2026, 07:38:33 AM »
(Using nettalk 14.38 and stringtheory 3.86)

I'm trying to get a webclient GET working with an IPv6 address (::1) and a specific port (8090), like this

::1:8090/yadayada

I've activated the LoggingOn property and it shows it reverts to port 80.

I think (!) the methods : .URLHostOnly and .URLPortOnly in stringtheory get confused by the use of "::" for the IPv6 address.

Maybe it needs to get the last ":" in the Host part of the url in order to seperate the port?

When I change:

    e = self.findChar(':',p,,pURL)

To:

    e = INSTRING(':',pURL,-1,s)

In both methods, it works (but I'm not sure wether this introduces side effects ...)

B.t.w. (local) server is IPv6 and via a browser (using [::1]:8090/yadayada) a get a valid response (and the server name shows up as "::1" in Nettalk)

14
Hi Bruce,

number 1 is het good answer  :)

(I looked in jfiles.clw to find something related to codepages or so, but I didn't realize it was all stringtheory behind the scenes). The prop:charset is a nice way to get all my stringtheory objects in the right codepage.

Thanks!

15
Hi Bruce,

two additional questions (both performance related):

1 - jFiles apparently does the translations of the "/u...." stuff somewhere when loading/parsing the data (but assumes another codepage?). Is this configurable? So can I set the target codepage prior to loading and all will be processed in one go?

2 - is the SELF.rP_web.Getvalue('_postdata_') somewhere accessable directly as a stringtheory object?

TIA,
Ton

Pages: [1] 2 3 ... 6