Web Connection
Can't get WC to run
Gravatar is a globally recognized avatar based on your email address. Can't get WC to run
  Tore Bleken
  All
  Jun 14, 2018 @ 04:26am

Boy, do I feel stupid, since I have worked with WC for so many years. All I can say as an excuse, is that this is a completely new setup on my laptop which has many old copies of WC sites. None of these have ever been run on this laptop. Plus I am clearly a slow learner... 😃

It's also a while since I worked with the latest versions.

I plan to go to the WWC training at SW Fox 2018, and wanted to get better prepared this year...

IIS is set up and configured properly, as far as I can see. The machine runs Win10-64 Pro, latest version.

I downloaded 6.20, and installed it in d:\wconnect. Except for the installation folder, everything is default. I noticed that wc.dll is in D:\wconnect\Web\wconnect\Bin.

When I Do Wcdemomain the console program runs, but I don't see anything in the console window when I click for instance Hello Web Connection. In the browser I get:

Server Error in '/wconnect' Application.
Input string was not in a correct format. Bla..bla..bla..

I have read the documentation and tried to fix it myself, but somehow my English isn't good enough to follow the process.

This is my complete wcdemo.ini:

[Main]
tempfilepath=.\temp\
template=wc_
logtofile=On
saverequestfiles=Off
showrequestdata=Off
showserverform=On
showstatus=On
scriptmode=1
timerinterval=200
Adminemail=youremail@yourserver.com
Adminmailserver=mail.yourserver.com
Adminsenderroremail=Off
Comreleaseurl=http://localhost/wconnect/ReleaseServers.wc
HomeUrl=http://localhost/wconnect/
Sqlconnectstring=server=(local);database=WestWindAdmin;
Memusage=8176

[Wwdemo]
Adoforeignconnectionstring=server=(local);database==WestWindAdmin;
Datapath=D:\WCONNECT\samples\wwDemo\
Htmlpagepath=d:\wconnect\web\wconnect\
VirtualPath=/wconnect/

[Wwmaint]
Datapath=D:\WCONNECT\samples\wwDemo\
Htmlpagepath=d:\wconnect\web\wconnect\
Virtualpath=/wconnect/

[Weblogpagehandler]
HtmlPagePath=d:\wconnect\web\wconnect\samples\weblog\
VirtualPath=/wconnect/weblog/

[Http]
Datapath=D:\WCONNECT\samples\wwDemo\
Htmlpagepath=d:\wconnect\web\wconnect\

And this is my wc.ini

[wwcgi]
;*** THIS DIRECTORY MUST HAVE READ AND WRITE ACCESS FOR THE
Path=d:\wconnect\temp\

;*** Message File Template (1st 3 letters)
;*** Default is "wc_"          Only needed if using a different template
Template=WC_

;*** Messaging Mechanism  of the DLL:    REQUIRED
;*** File       -   Original Web Connection Logic of 
;                   file based messaging
;*** Automation  -  Use OLE Automation Server Interface
;*** Interactive -  Call up the VFP development environment via Automation
Mechanism=File

;*** Time to allow request to finish
;*** Process will be terminated after number of secs
;*** specified here.           REQUIRED 
Timeout=60

;*** Specify how often wc.dll polls for 'completion' message
;*** Specify in milliseconds.  REQUIRED FOR FILE BASED
PollTime=100

;*** Max size of the POST buffer. You can use this to limit
;*** the size of uploads. Value in bytes. 0 - no size checks.
PostBufferLimit=0

;*** Determines whether the ISAPI DLL uses Impersonation
;*** or uses the default running environmnet account (SYSTEM/NETWORK SERVICE)
;*** 0 - Run under host process account  1 - Run under impersonated account (IUSR_ or login)
Impersonation=0

;*** PostMethod   -  URLEncoded or INI 
PostMethod=UrlEncoded

;*** Account for Admin tasks    REQUIRED FOR ADMIN TASKS
;***       NT User Account   -  The specified user must log in
;***       Any               -  Any logged in user
;***                         -  Blank - no Authentication
AdminAccount=

;Admin Page that is used for Backlinks from various internal pages
;Use a full server relative Web path!
AdminPage=/wconnect/admin/Admin.aspx

;*** You can update an EXE on the fly from the UpdateFile
;*** With File base messaging you can also use StartEXE to start the
;*** ExeFile running
ExeFile=C:\WEBCONNECTION\FOX\Webdemo.exe
UpdateFile=C:\WebConnectionProjects\WebDemo\Deploy\TempWebdemo.exe
FileStartInstances=0

;*** Determines whether the ISAPI DLL logs every request
;*** by writing a start and complete entry in wcErrors.txt
;***    0  -   No Logging (Errors are still logged though)
;***    1  -   Start and Complete logging
LogDetail=0

;*** If set double checks for a RequestId HTTP header on
;*** on return and matches the inbound request Id with the
;*** outbound request id
;***      0   -   Don't validate
;***      1   -   Validate and Show Error on failure
;***      2   -   Validate and Kill Application Pool on failure
ValidateRequestId=1

; Add any extra HTTP Server variables that you 
; want to include your request. Handles custom
; vars than defaults.  var1,var2,var3 etc as key names
[Extra Server Variables]
;Var1=LOCAL_ADDR
;Var2=APPL_MD_PATH

[Automation Servers]
;*** Severloading - 0 - Normal - First available   1 - Forced Round Robin
ServerLoading=1
KeepAlive=1

;*** Force users to see message while servers are loading
;*** Set to one if you have problems getting servers loaded
;*** in high volume environments
COMLoadLockout=0

Server1=wcDemo.wcDemoServer
Server2=wcDemo.wcDemoServer
;Server3=wcDemo.wcDemoServer
;Server4=wcDemo.wcDemoServer
;Server5=wcDemo.wcDemoServer
;Server6=wcDemo.wcDemoServer
;Server7=wcDemo.wcDemoServer
;Server8=wcDemo.wcDemoServer
;Server9=wcDemo.wcDemoServer
;Server10=wcDemo.wcDemoServer
;Server11=wcDemo.wcDemoServer
;Server12=wcDemo.wcDemoServer
;Server2=Webdemo.WebdemoServer
;Server3=Webdemo.WebdemoServer

;*** Determines whether CoInitialize for COM objects
;*** Set this option to 1 only if your servers do not
;*** load and given an error message to the effect 
;*** that COM is not initialized. Should only be needed
;*** on ancient or non-Microsoft Web Servers.
CallCoInitialize=0

[HTML PAGES]
Busy=
NoOutput=
OleError=
;*** Use these to override DLL messages
;Maintenance=c:\somepath\somepage.htm
Execption=
Maintainance=
NoLoad=
PostBufferSize=

And last, here's my web.config:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <appSettings>
    <add key="enableSimpleMembership" value="false" />
  </appSettings>
  <webConnectionConfiguration>
    <!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
    <add key="MessagingMechanism" value="File" />
    <add key="Timeout" value="90" />
    <add key="TempPath" value="~\..\..\temp\" />
    <add key="TempFilePrefix" value="WC_" />
    <add key="ComServerProgId" value="wconnect.wconnectServer" />
    <add key="ComServerLoadingMode" value="LoadBased" />
    <add key="ServerCount" value="2" />
    <add key="AutoStartServers" value="False" />
    <add key="ExeFile" value="~\..\..\wcdemo.exe" />
    <add key="UpdateFile" value="~\..\..\wcdemo_Update.exe" />
    <add key="AdminAccount" value="ANY" />
    <add key="AdminPage" value="~/admin/admin.aspx" />
    <add key="LogDetail" value="False" />
    <add key="ValidateRequest" value="False" />
    <add key="MessageDisplayFooter" value="Generated by Web Connection IIS .NET Connector Module" />
    <add key="UseCustomManifestLoading" value="False" />
    <add key="AuthenticationMode" value="Default" />
    <add key="PassAspNetContext" value="False" />
  </webConnectionConfiguration>
  <webConnectionVisualStudio>
    <!-- Configuration Settings for the Web Connection Visual Studio Add-in 
       Not used at runtime, only at the design time -->
    <add key="FoxProjectBasePath" value="d:\wconnect\deploy\" />
    <add key="WebProjectBasePath" value="d:\wconnect\web\wconnect\" />
    <add key="WebProjectVirtual" value="http://localhost/wconnect" />
    <!-- Optional PRG launched when VFP IDE launches -->
    <add key="IdeOnLoadPrg" value="" />
    <!-- The default browser used. Blank IE Automation, otherwise specify browser exe path -->
    <add key="WebBrowser" value="" />
    <!-- <add key="WebBrowserAlternate" value="C:\Program Files (x86)\mozilla firefox\firefox.exe" /> -->
    <add key="WebBrowserAlternate" value="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" />
    <!-- The editor used to edit FoxPro code - blank means FoxPro Editor is used -->
    <add key="FoxProEditor" value="" />
    <add key="FoxProEditorAlternate" value="C:\Program Files\Microsoft VS Code\code.exe" />
  </webConnectionVisualStudio>
  <system.web>
    <compilation defaultLanguage="c#" debug="true" targetFramework="4.0" />
    <!-- ASP.NET Request Limit Configuration for POST buffer and Script Timeout -->
    <httpRuntime maxRequestLength="10000000" executionTimeout="120" requestValidationMode="2.0" />
    <!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
    <trust level="Full" />
    <httpHandlers>
    </httpHandlers>
    <httpModules>
    </httpModules>
  </system.web>
  <!-- IIS 7 Script Map Configuration -->
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <!-- use this on IIS 7.5 and later to bypass IIS default Error handlers for failures -->
    <!-- httpErrors existingResponse="PassThrough" /-->
    <!-- IIS 7 Script Map Configuration -->
    <handlers>
      <add name=".wc_wconnect-module" path="*.wc" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
      <add name=".wcs_wconnect-module" path="*.wcs" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
      <add name=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
      <add name=".wwd_wconnect-module" path="*.wwd" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
      <add name=".ms_wconnect-module" path="*.ms" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
      <add name=".blog_wconnect-module" path="*.blog" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
    </handlers>
    <!-- 
      EXTENSIONLESS URL HANDLING
      - Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)

      matches any URLs that do not have a '.' in the path    
  -->
    <!--
    <rewrite>
      <rules>
        <rule name="ExtensionlessUrl" patternSyntax="ECMAScript" stopProcessing="true">          
          <match url=".[^.]*$"  />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="api/UrlRewriteHandler.av" appendQueryString="true" />
        </rule>
      </rules>
    </rewrite>    
  -->
  </system.webServer>
</configuration>
Gravatar is a globally recognized avatar based on your email address. re: Can't get WC to run
  Rick Strahl
  Tore Bleken
  Jun 14, 2018 @ 12:12pm

Post a screen shot of the IIS error page. There should be lots more information on the error page about what the issue is on the bottom.

It sounds like the virtual is not configured properly.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Can't get WC to run
  Tore Bleken
  Rick Strahl
  Jun 14, 2018 @ 12:15pm

Do you mean this one?

Gravatar is a globally recognized avatar based on your email address. re: Can't get WC to run
  Rick Strahl
  Tore Bleken
  Jun 14, 2018 @ 12:29pm

You have an invalid value in the web.config file I believe. It's a config parsing error so most likely the Web Connection configuration has some invalid character in one of the values. Make sure the keys are properly XML encoded.

I don't see any thing wrong with your data you have posted earlier, but maybe open the document in an XML editor that validates and see what it shows (visual studio will validate as does VS Code with an XML addin I believe).

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Can't get WC to run
  Tore Bleken
  Rick Strahl
  Jun 14, 2018 @ 12:31pm

I already posted that file, which I haven't touched at all. Please take a look at it. Or can you hint what in particular I should look into?

I have tried to install several times, both on d:\wconnect and d:\wconnect. At one time I saw a reference to d:\wconnect even though I tried to run it from c:\wconnect. I prefer to have all my development on d: so that's where it is now.

After each install I completely removed the old folder, could be some "old" file which "confuses"?

Maybe I should try yet another install? If so, are there any files I should be sure to delete, or anything else I should do first?

NB! I received an email with a copy of your first reply, but not to the second one. Is that normal?

Gravatar is a globally recognized avatar based on your email address. re: Can't get WC to run
  Rick Strahl
  Tore Bleken
  Jun 14, 2018 @ 08:00pm

Honestly I'm not sure. I tried this here with the download from the registered version and it all worked on the first try.

  • Download
  • Install into clean /wconnect folder
  • Run Setup stock options (except I install to a non-default server instance)
  • Open default.htm
  • Start Web Connection server
  • Hit Hello World request
  • Get Hello World response

I looked closer at your error message and it looks like it's failing in the constructor of the App class. There is code in there that works on a decimal value, but that value is coming from version numbers and I can't really see how this could be failing unless there is a permissions issue or some other failure that doesn't allow access to the actual DLL executing (which would be very strange).

Specifically this code:

Version version = Assembly.GetExecutingAssembly().GetName().Version;
string stringVersion = version.Major + "." + version.Minor;
Version = decimal.Parse(stringVersion)

which should in theory never fail. I replaced this with:

Version version = Assembly.GetExecutingAssembly().GetName().Version;
string stringVersion = version.Major + "." + version.Minor;
if(!decimal.TryParse(stringVersion, out Version))
   Version = 6;

If you run this new code and see the version 6.0 in the Module admin then we know this is what was causing the problems.

You can download an updated WebConnectionModule.dll from here:

There's other stuff in there but you only need the module. Put that in your site's bin folder.

Before you do, though, can you check the version number for the old DLL first? What does that say? The new version should be 6.20.1 the old one (if it's the latest version) 6.20. Then copy the file and let me know if that still fails.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Can't get WC to run
  Tore Bleken
  Rick Strahl
  Jun 14, 2018 @ 10:53pm

I replaced WebConnectionModule.dll with the new one, and it worked immediately. It's good to know that it wasn't something I had done.

Thanks a lot! 😃

Gravatar is a globally recognized avatar based on your email address. re: Can't get WC to run
  Rick Strahl
  Tore Bleken
  Jun 14, 2018 @ 11:07pm

Crap - I just realized why it's not working. It's your culture settings for Norway that's throwing off my faulty code 😃

The separator - . vs. , for the decimal separator.

Better version:

Version version = Assembly.GetExecutingAssembly().GetName().Version;
Version = version.Major + (version.Minor / 100);            
WebConnectionVersion = "Web Connection " + Version + " (.NET Handler)";

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Can't get WC to run
  Tore Bleken
  Rick Strahl
  Jun 15, 2018 @ 12:39am

Sounds like a good explanation, even though I have done quite a lot to avoid that problem. I use US English Windows, and most of my programs are English versions. But in order to get my keyboard working "normally", I need to use a decimal comma, although I would prefer to have a decimal point.

I'm leaving for a few days' vacation, I guess you will create a new dll before I'm back.

Gravatar is a globally recognized avatar based on your email address. re: Can't get WC to run
  Rick Strahl
  Tore Bleken
  Jun 15, 2018 @ 12:42am

Kind of surprised nobody else has reported this - this should be be biting anybody running in a non-US language that uses commas for decimal points which is most non-US locales.

Well Web Connection 6.21 is out and that has this bug fixed. Thanks Tore.

I guess this shows that most people are not updating their versions to the latest release DLLs 😦

+++ Rick ---

© 1996-2024