KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Interacting with the Web Server Objects
PRODUCT: 4D | VERSION: 18 R3 | PLATFORM: Mac & Win
Published On: July 6, 2020

A new feature of 4D v18 R3 is a new way to gather information on the 4D Web Servers using objects which supplements the capability of running multiple Web Servers on a single application by running additional ones from a components. The new command WEB Server returns an object containing multiple read-only properties of a specified web server. Since multiple web servers can be ran the command takes in one parameter to specify which Web Server object to return based on the following three constants.

Web server database (1) - This is the default value if no parameter is passed and will return an object representing the web server from the current database (component or host) calling the command.

Web server host database (2) - This will force the command to return a web server object containing data of the host database even if called from a component. If called from a host database, passing Web server database or Web server host database return the same object.

Web receiving request (3) - This will return the web server object of the server that received a request, but will also be able to return Null if there is no web server receiving a request. This is useful in complex generic/dynamic code that will interact with any/all web servers. For the most part the executing web process will be from the current database and the web server object can be obtained with Web server database, while receiving a Null from WEB Server can help confirm that the current process is not a web process.

While the properties are read-only, they can be changed using the existing WEB SET OPTION command.