Regarding AVFP REST in C/S (SQL Server)
1) To reduce ‘port exhaustion’ due to spamming attack, we need to open DB connection only once per page. The best way to handle this in non-REST implementation is to open the connection in the header section and close it in the footer section of AVFP page (
or just before oresponse.redirect() etc). This works just fine.
In REST implementations, we can do the same in the init() and Destroy() events of the Controller.
However, the RestController class does not implement these methods which are causing problems in my external debugger.
It would do no harm to existing installations if these two methods are implemented in RestController class.
2) To repeat my previous comments on this, we need to reference resources with full paths to avoid making environment assumptions.
oJason = NewObject(‘jason’,’json.prg’)
3) I’ve recently started playing with AVFP ‘REST’.
I did not think it was possible but I am happy to report that I was able to call a Sample.AVFP page, both directly (i.e. non-Rest) and also from the controller. We just need to fill-in the missing oProp values in the Controller’s ‘action’. I doubt I'll do that
in development but I am impressed by this flexibility.
*Set Step On
cHTML = ""
- SET PROC to substr(oProp.AppStartPath,1,AT(,oProp.AppStartPath,2))+'prg\AVFPutilities' ADDITIVE && moved to Init(). Released in Destroy()
- Load missing values of oProp
oProp.Ext = IIF(EMPTY(oProp.Ext),".avfp",oProp.Ext)