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

Pages: 1 2 [3] 4 5 ... 20
31
Web Server - Ask For Help / NetTalk 11 template variables?
« on: May 21, 2019, 09:28:52 PM »
Hi,

Attached is a list of "unknown" template variables that are displayed when I compile an app and get errors. I'm not sure in which these variables are used - I did a search in the Clarion11 folder and couldn't find anything. I need to start somewhere, so I thought that NetTalk 11 might be the source.

Can anyone confirm whether these variables are used in NetTalk 11 please?

Thanks
Thys

32
Hi Bruce.

Yes, I missed to explain the context of my test. I'm not trying to download a file as part of a web app - rather as part of a set of web services. The web40 demo has a procedure GenerateFile which is similar to the one I've been using in Integrat.

I'm making a call like this (from Postman for API testing) anb expect a file to be received on the client:

http://127.0.0.1:88/GenerateFile

In the procedure of the app I sent, I set the variable loc:filename for the file to be downloaded as a file within the exe folder. Within the procedure, p_web._SendFile is then called twice, and the logic for the second call puzzles me - because the CaseStart: routine won't find a procedure with the same name as the file to be downloaded.

As a last note, this will be used as part of a set of web services, where a client may request to download a file that was previously uploaded or may have been generated by a web service call. So if there is any other way to do a file download, I will like to try it as well. But as said before, this was working perfectly in NT 10, seems it has changed in NT 11.

Thys

33
Hi,

See attached. I checked again by setting loc:filename to a PEM file that's already in the EXE folder. I added a trace and could see that _SendFile is called twice.

Thanks Bruce.

34
Web Server - Ask For Help / Page's _SendFile method is called twice
« on: May 14, 2019, 02:29:52 AM »
Hi,

I have an app Integrat that contains a combination of web services and pages. One specific page is called "DownloadFileEx", that receives a parameter "DocumentID" to indicate which document must be downloaded. An example:

http://127.0.0.1:8080/DownloadFileEx?DocumentID=b.txt

 After investigating why the page is not found in the WebHandler procedure, it seems as if p_web._SendFile is called twice - once for "DocumentFileEx" and a second time for the file to be downloaded "b.txt".

When the second call to p_web._SendFile is made for the file to be downloaded, the routine CaseStart:Integrat does not find something called "b.txt" and returns loc:done = false, meaning that the whole request has an error - which is not true. It seams like the logic to call p_web._SendFile a second time in the WebHandler is wrong - shouldn't it be up to the procedure "DownloadFileEx" to retrieve the file?

This was working in NetTalk 10, not sure how to make this work here.

Thanks
Thys

35
Thanks. Until then I've changed the CLW file not to run the code in CheckForDuplicates. It works out that if there was a duplicate then SQL returns the correct error description.

36
Hi Bruce.

How did you fix the problem? I would like to do the same in the code - and get the "formal" fix when 11.08 is available.

Thanks
Thys

37
Hi Bruce.

This happens in the DeleteRecord:* routine, where p_web.AddServiceError() is called if the delete was not successful. So the value of p_web.ErrorCode() used in that statement returns 30 with p_web.Error() being "Entry not found" - referring to a queue read error. But the actual underlying error code should have been 90 (File System Error) with p_web.FileError() describing why the record can't be deleted. But p_web.FileErrorCode() returns 0, so my only conclusion is that some other Clarion statements where executed after the delete was done, before the value NetWebServerWorkerBase.LastError is set.

Thys

38
Hi,

Using PostgreSQL, when a record is deleted and an error occurs because of a FK constraint, the value of p_web.ErrorCode() is not correct. It seems as of the underlying Clarion values of ERRORCODE(), ERROR(), FILEERRORCODE() and FILEERROR() have been altered because other Clarion statements that have also been executed - and not directly after the DELETE statement.

I get the following back in the error description:

Error occured Deleting the record 30] Entry Not Found 0

which indicates error 30 that is "A GET to a QUEUE has failed" according to Clarion help. The actual error when running the delete against SQL is this:

The DELETE statement conflicted with the REFERENCE constraint "FK_dbo.TripExpenses_dbo.Trips_trip_ID". The conflict occurred in database "Commalong", table "dbo.TripExpenses", column 'trip_ID'.

So the error in the response does not show the correct reason.

Thanks
Thys

39
Hi,

When using MSSQL, new records are added with PK-values that the server allocates (typically using IDENTITY or NEWGUID defaults). In the Clarion dictionary, the READONLY attribute is added to the External Name of the column, which stops the Clarion driver to add the PK column in the INSERT statement. In the InsertRecord: routine, the statement p_web.AddServiceResult () is used to generate the response JSON. But the PK value has not been returned yet at that stage into the file buffer, so the response states the PK-value is zero (in the case of an integer-type).

One way could have been to set the AUTOINCUSESSCOPEIDENTITY option on the table to true, which uses SCOPE_IDENTITY() to return the last insert done on the same connection. But for some reason this does not work and returns an error. So my only solution is to make a call "SELECT @@INDENTITY" right after the insert, and bring the result back into the file buffer. But there is no embed point before the call to AddServiceResult - which would help me to get the inserted PK-value first before the JSON response is generated. Can this embed point be added please?

Thys

40
Installed NT 10 and problems solved for now.

41
I even removed the descriptions (as well as deleting all existing CLW's, and the MAP and OBJ folder), it still persists in generating the old descriptions with two single quotes around them. Where does it remember this from?

42
Hi,

Where I've added a parameter description on a service method using single quotes, in the help generation of this parameter it doubles the quotes. How do I get this back to normal? See attached.

Using Clarion 11 and NT 11.07.

Thys

43
Hi,

I have a view in the response of a call. On the template screen I set the sort order of the view to the NAME column of the table. But when the append statement is called to populate JSON like here:

jsonResults.append(MedicalAidView,'MedicalAid')

the sort order of NAME is ignored and the response is sorted by the primary key column. Is there a way to fix this please?

Thys

44
Hi,

Although my DCT is already set up with timestamp columns, I'm not using them yet for syncing. On the APPS tab of the global extension template, "Allow Sync in Service Methods" and "Generate for Disconnected App" is not switched on. But the NewWebServiceMethod template still generates code for the timestamp columns.

Is there a setting to totally disregard syncing and not using the timestamp columns?

Thys

Pages: 1 2 [3] 4 5 ... 20