Web Connection
Config object not populating
Gravatar is a globally recognized avatar based on your email address. Config object not populating
  Stein Goering
  All
  Dec 17, 2024 @ 05:26pm

I've been using the REST API for my current project with Vue.js on the front end. Happy with the results so far - just deployed the app to production.

However, I ran into an issue with a new feature I'm working on - it was not finding the location for Config.cHTMLPagePath despite having it set in the INI file:

TempFilePath=.\temp\
Template=WC_
TimerInterval=200
ScriptMode=1
logformat=3
DebugMode=On
LiveReloadEnabled=Off
HTMLPagePath=F:\WebConnectionProjects\SCP\Web\
DATAPath=F:\WebConnectionProjects\SCP\deploy\Data\
VirtualPath=/SCP/
HomeUrl=http://localhost/SCP
showrequestdata=Off
showserverform=On
showstatus=On
COMReleaseUrl=http://localhost/SCP/ReleaseComServers.wc
UnattendedComMode=On
Memusage=8176
Adminemail=admin@mw3.net
Adminmailpassword=
Adminmailserver=localhost
Adminmailusername=
Adminmailusessl=Off
Adminsenderroremail=Off

I used ObjectToXML to dump the contents of the Config object to a log file - you can see that property along with cDataPath come up empty:

		<cfilename></cfilename>
		<chtmlpagepath></chtmlpagepath>
		<cmode>INI</cmode>
		<cregnode>Parameters</cregnode>
		<cregpath>SOFTWARE\West Wind Technologies\Config</cregpath>
		<csmtppwd></csmtppwd>
		<cstmpuser></cstmpuser>
		<csubname>config</csubname>
		<cvirtualpath>/SCP/</cvirtualpath>
		<lstriptypeprefix>1</lstriptypeprefix>
		<oxml>NULL</oxml>

Looking at the contents of Server.oConfig shows that it did pick up entries from the INI file, e.g. adminEmail:

		<cadminemail>admin@mw3.net</cadminemail>
		<cadminmailpassword></cadminmailpassword>
		<cadminmailserver>localhost</cadminmailserver>
		<cadminmailusername></cadminmailusername>
		<capplicationname>West Wind Web Connection</capplicationname>
		<ccodeeditorcommandline>code ..\</ccodeeditorcommandline>
		<ccomreleaseurl>http://localhost/SCP/ReleaseComServers.wc</ccomreleaseurl>
		<cdeploymentmode>Production</cdeploymentmode>
		<cfilename>F:\WEBCONNECTIONPROJECTS\SCP\DEPLOY\Scp.ini</cfilename>
		<chomeurl>http://localhost/SCP</chomeurl>
		<chtmlpagepath>F:\WebConnectionProjects\SCP\Web\</chtmlpagepath>
		<cmode>INI</cmode>
		<cpostscriptpdfprinterdriver>Microsoft Print to PDF</cpostscriptpdfprinterdriver>
		<cregnode>Parameters</cregnode>
		<cregpath>SOFTWARE\West Wind Technologies\Config</cregpath>
		<csqlconnectstring></csqlconnectstring>
		<csubname>Main</csubname>
		<csystemfilesdatapath></csystemfilesdatapath>
		<ctempfilepath>.\temp\</ctempfilepath>
		<ctemplate>WC_</ctemplate>
		<cversion>1.0</cversion>
		<ladminmailusessl>0</ladminmailusessl>
		<ladminsenderroremail>0</ladminsenderroremail>
		<ldebugmode>1</ldebugmode>
		<llivereloadenabled>0</llivereloadenabled>
		<lmarkdownpagesanitized>1</lmarkdownpagesanitized>
		<lshowdesktopform>0</lshowdesktopform>
		<lshowrequestdata>0</lshowrequestdata>
		<lshowserverform>1</lshowserverform>
		<lshowstatus>1</lshowstatus>
		<lstriptypeprefix>1</lstriptypeprefix>
		<lunattendedcommode>1</lunattendedcommode>
		<nlogformat>3</nlogformat>
		<nmemusage>8176</nmemusage>
		<npageparsemode>1</npageparsemode>
		<nscriptmode>1</nscriptmode>
		<ntimerinterval>200</ntimerinterval>
		<oscpprocess>(Object)</oscpprocess>
		<owwmaint>(Object)</owwmaint>
		<oxml>NULL</oxml>

Somehow I thought Config and Server.oConfig pointed to the same object? IAC, I don't recall Config issues with other WC projects; not sure what I did wrong. Here's the code from my main PRG:

***************************************************************
DEFINE CLASS ScpConfig AS wwServerConfig
****************************************************************


oSCPProcess = .NULL.

*** ADD CONFIG OBJECT TO CLASS ABOVE - DO NOT MOVE THIS LINE ***

owwMaint = .NULL.

FUNCTION Init

THIS.oSCPProcess = CREATEOBJECT("SCPProcessConfig")

*** ADD CONFIG INIT CODE ABOVE - DO NOT MOVE THIS LINE ***

THIS.owwMaint = CREATEOBJECT("wwMaintConfig")

ENDFUNC

ENDDEFINE
*EOC ScpConfig


DEFINE CLASS wwMaintConfig as RELATION

cHTMLPagePath = ""
cDATAPath = ".\data"
cVirtualPath = "/SCP/"

ENDDEFINE



*** Configuration class for the SCPProcess Process class
DEFINE CLASS SCPProcessConfig as wwConfig

cHTMLPagePath = ""
cDATAPath = ""
cVirtualPath = "/SCP/"
cSTMPUser = ""
cSMTPPwd = ""

ENDDEFINE

*** ADD PROCESS CONFIG CLASSES ABOVE - DO NOT MOVE THIS LINE ***


--stein

Gravatar is a globally recognized avatar based on your email address. re: Config object not populating
  Marcel DESMET
  Stein Goering
  Dec 18, 2024 @ 11:36am

Hello,

Not same, but I had a similar problem, I don't remember exactly how it was solved but I think some paths on the server are build in a different way with online server admin tools ( jumping from 6.2 TO 8.1 )

https://support.west-wind.com/Thread70S0LKKPK.wwt

Gravatar is a globally recognized avatar based on your email address. re: Config object not populating
  Rick Strahl
  Stein Goering
  Dec 18, 2024 @ 01:03pm

Config.cHtmlPath is set at the Process level in the process subkeys of the startup INI file.

[Main] <--- not here
...

[wwDemo]  <--- here and each process key
HtmlPagePath=...

Note that cHtmlPagePath is an optional setting that is no longer used for anything other than your own usage. In the past I would control the paths for certain things like default Web path etc. for resolving the Physical Path. Since that's no longer necessary in IIS or the Web Connection Web Server (Apache was the outlier not no longer explicitly supported) as the Physical Path and the Web root of is returned as part of the IIS server variables.

+++ Rick ---

© 1996-2025