ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help /  / 
  • Overview
  • Characteristics of the prologue procedure
  • 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 service: Prologue procedure (executed before each call)
Overview
You can specify that a procedure 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.
Characteristics of the prologue procedure
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, to verify that the client has authenticated and is allowed to call these entry points.
All web service functions are available when calling this procedure.
You can reject the call to the entry point by following these steps:
  1. Call WebserviceWriteHTTPCode to specify the return code and the possible content of the response.
  2. Indicate that the call should be rejected using the "RETURN False" statement.

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 one of these descriptions has its own prologue procedure (which can be the same, different or even nonexistent).
Example of 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 between 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: 01/31/2025

Send a report | Local help