NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Poul on November 04, 2015, 12:12:25 PM
-
Following example webinars on how to use a web-service to upload a file.
My client uses a simple POST. no Soap, no JSON.I kept GPFing the server, and have found two anomalies
in my NetWebServiceMethod
I am using a 'File' type parameter which is a local Stringtheory object called Incomingfile - just like webinar example.
it generates something like this
PrimeParameters routine
!clear all table record structures nice and early.
IncomingFile = p_web.MethodParameter ! REST default parameter. May be overridden lower down
Case p_web.RequestMethodType
of NetWebServer_GET
of NetWebServer_POST
of NetWebServer_PUT
of NetWebServer_DELETE
End
If p_web.xml = 0 and p_web.json = 0 ! incoming parameters are just url encoded, either in the URL, or as post data, or as a cookie.
IncomingFile.Free()
If p_web.IfExistsValue('IncomingFile') then IncomingFile.SetValue(p_web.GetFileFromPost('IncomingFile')).
...
I GPF on IncomingFile.Free() i believe because of
IncomingFile = p_web.MethodParameter ! REST default parameter. May be overridden lower down
commenting this line allows the code to execute.
also if i tick the send parameters to debugview it generates a comple error.
p_web.Trace('IncomingFile = ' & IncomingFile.Sub(1,100 & ' .....' )
-
thanks for the report Poul.
fixed in 8.64, which is now up.
cheers
Bruce
-
Thanks Bruce,
That appeared to Work, but i am seeing a strange generating problem after this update.
the first line in the Prime Parameters Routine
"Sometimes" Generates Correctly
IncomingFile.SetValue(p_web.MethodParameter,st:clip) ! REST default parameter. May be overridden lower down
then other times generates incorrectly:
IncomingFile = p_web.MethodParameter ! REST default parameter. May be overridden lower down
I am not touching the NetWebServiceMethod procedure itself, but I am touching a Procedure it calls (and it happens to be in the same module)
I have not discerned what exactly triggers the behaviour, as sometimes it works thru many regenerates, before it generates the wrong code.
if I simply touch the description in the actions for the Procedure in the IDE and then generate again it generates the correct code !?
i am using C9.1