Websydian v6.1 online documentationOnline documentation - WebsydianExpress v3.0

WebsydianExpress - Callback Point


BeforeRequestStart

Type

Global callback point implemented by the WebsydianExpress runtime.

Note that changing the callback functions for a global callback point impacts all the sites.

When is the callback point called

BeforeRequestStart is called after the request has been received by the runtime, but before any handling of the request has been performed.

How does the callback point influence later functionality

In the callback function:

Set the local field CallbackOutput<ContinueProcessing> to Yes will let the normal handling proceed.

Set the local field CallbackOutput<ContinueProcessing> to No to stop all handling of the request.

If one callback function set ContinueProcessing to No, the rest of the callback functions will not be

In this way, this callback point offers the possibility to take full control of the handling of a request.

Please note that this includes all handling - including calling a PageGenerator function if you want anything to be sent to the browser.

You must also note that the request has not been parsed or in any way interpreted when this function is called. If you do need to use this function, contact websydian support with a description of your case to obtain information about how you can retrieve the relevant request headers and the request body.

Example of use

The case for this callback function was an installation, where it also was necessary to be able to process web service requests using the same URL.

By checking the content type header, it was possible to find the requests that contained xml. If this was the case a service function that was specially designed to handle the web service requests was called.

After calling this service function, the ContinueProcessing flag was set to No to prevent the normal handling of the request.

Abstract callback function

Inherit from Callback.WebServer.BeforeRequestStart.AbstractCallbackFunction to create a callback function that can be called by this callback point.

CallbackOutput

You must populate this field before the callback function terminates. The value will be automatically transferred to the calling Callback Point.