Help / WLanguage / WLanguage functions / Communication / Web services
  • Overview
  • Characteristics
  • Advanced cases
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
REST Services: Prologue procedure (executed before each call)
It is now possible to specify in the description of a Webservice that a procedure must be called (and executed automatically) each time a Webservice is called. This makes it possible, for example, to set up security or billing systems, such as checking a token passed in the header.
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 Webservice functions are available during the call to this procedure.
It is possible to reject the call to the entry point:
  1. Calling WebserviceWriteHTTPCode to give the return code and the possible content of the response.
  2. Followed by "RETURN False" to specify that the call must be rejected.

Advanced cases

This procedure is run every time an entry point of a REST Webservice description is called. But a REST Webservice can be made of several REST Webservice descriptions. Each one of these descriptions has its own prologue procedure (which can be the same, different or even non-existent).
Example: a Webservice 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 Webservice.
Minimum version required
  • Version 24
This page is also available for…
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help