ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help /  / 
  • Overview
  • Prologue procedure features
  • Advanced cases
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
REST web services: Prologue procedure (executed before each call)
Overview
It is now possible to specify in the description of a web service that a procedure must be called (and executed automatically) each time a web service is called. This makes it possible, for example, to set up security or billing systems, such as checking a token passed in the header.
Prologue procedure features
This procedure is run every time an entry point is called, just before the procedure associated with that entry point.
This procedure makes it possible to run code that must be run for all the entry points. For example, verify that the client has authenticated himself and that he has the right to call the entry points.
All web service functions are available during the call to this procedure.
It is possible to reject the call to the entry point:
  1. Call the WebserviceWriteHTTPCode function to give the return code and any response content.
  2. Line of code "RETURN False" to indicate that the call should be denied.

Advanced cases

This procedure is run every time an entry point of a REST web service description is called. But a REST web service can be made of several REST web service descriptions. Each description has its own prologue procedure (which may be the same, different or none at all).
Example: a web service with authentication:
  • "REST_Authentication", a first description without prologue procedure, with entry points to authenticate the user.
    This description can be shared among several projects.
  • A second description with prologue procedure that verifies authentication.
    This description is specific to this REST web service.
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/17/2024

Send a report | Local help