wwServer::ReloadComServers

This method can be used to reload COM Servers from within your Web Connection application code. The most common scneario for this feature is to refresh configuration file settings.

This method calls the Web Connection Server Release URL which forces servers to shut down and restart and re-reread their startup configuration file settings.

Requirements:

This operation fires an asynchronous HTTP request against the ComReleaseUrl. The asynchronous call makes it possible to return a server response from a request that fires it.

Note Username and Password are likely required and your application will have to provide this info somehow in order to allow access to this administrative URL. Some ways to do this is either to store the information somewhere and read it in at runtime, or prompt the user for it as part of the operation that triggers the restart.

o.Reload(lcUsername,lcPassword,lcUrl)

Parameters

lcUsername
Username required to access the Release Url.

lcPassword
Password required to access the Release Url.

lcUrl
Optional - the URL to the COM ReleaseUrl. If not provided Server.cComReleaseUrl is used - make sure this value is set correctly in YourApp.Ini or in Server.SetServerEnvironment.

Example

*** Example of Process method that updates the Server Config file
FUNCTION UpdateConfig

IF !Request.IsPostBack()
	*** Page that displays Config editing
	Response.ExandTemplate(Response.GetPhysicalPath())
    RETURN
ENDIF

*** Update Configuration Settings
*** Do whatever you need to modify config settings.
Request.FormVarsToObject(Server.oConfig.oMyApp,"txt")


*** Save the Configuration settings back to the INI file
Server.oConfig.Save()

*** Reload COM Servers causing re-reading of INI settings
IF Server.ReloadComServers("rstrahl",GetSystemPassword(),Server.cComReleaseUrl)
   this.StandardPage("Submitted servers for reloading.")
ELSE
   this.StandardPage("Couldn't reload servers.")
ENDIF   

ENDFUNC

See also:

Class wwServerConfig

© West Wind Technologies, 1996-2022 • Updated: 12/15/15
Comment or report problem with topic