|
|
|
|
|
- Overview
- Prologue procedure features
- Advanced cases
REST web services: Prologue procedure (executed before each call)
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: - Call the WebserviceWriteHTTPCode function to give the return code and any response content.
- 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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|