Web Connection
Instantiation of COM server from IIS
Gravatar is a globally recognized avatar based on your email address. Instantiation of COM server from IIS
  VFPJCOOK
  All
  Oct 7, 2023 @ 09:35am

Rick, In our recent help session where you connected to my workstation, I told you that I had taken the REST service VFP project generated by the WC Management Console and used the code from that project to create a Visual FoxExpress project. You said that I might get that to work in File Mode but you did not believe it would work in COM mode. You said that you felt that way because when running under IIS and the COM server (wwServer) gets instantiated, it would never execute/get to the READ EVENTS line of code. That's probably not very clear. There is a READ EVENTS in the main.prg that gets generated by WC. It is after the instantiation of the wwServer. I assume (and maybe wrong), that READ EVENTS is there so that the server form is visible and waits for requests until the exit button is clicked. When running in COM mode, the server form is not visible so the READ EVENTS is not only unnecessary but it does not get executed because when a COM server gets instantiated, something about how that happens (over my head) simply keeps it alive till I guess the service is stopped. If all of that is true, my question is why would this behavior be different if executed from a VFE version of the project? I know I told you that I would just accept that you are correct but I am having all sorts of issues trying to instantiate a VFE application (to do my business logic) from the WC wwServer and it would just be a lot easier if I could get my VFE version of the WC project to work. I should mention, I CAN instantiate a VFE application that is compiled into a COM server from the wwServer but I was trying (as you suggested) to not do that. Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  Rick Strahl
  VFPJCOOK
  Oct 7, 2023 @ 05:53pm

Sigh. Really? We're doing this again?

John it's very simple:

The Web Connection server when running COM is not under your control. It's invoked by the Web Connection Web connector, and it has to follow the exact Web Connection COM Server interface because the IIS connector instantiates, manages and calls that server.

There's no main program in COM, no READ EVENTS.

If your COM server can run as COM object, it can also be called from the Web Connection server instance - it is no different than instantiating a COM object if that works. If you do it as we discussed and store the instance on the Web Connection server instance, the VFE instance persists for the lifetime fo the server across many requests.

In a Web Connection application the top level object has to be the Web Connection server if you want it to work with COM. You can do different things in File based because it's not invoking the server directly, but in COM the Web Connection server has to be the object that is created and invoked by the calling IIS connector.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 9, 2023 @ 12:35am

OK, that creates 2 questions:

  1. This is just to have a better understanding: When running one of the projects generated by the Management Console (so any of the demo projects, etc), the documentation explains running in File Mode vs COM. I know I can go to the Administration page and switch between File Mode and COM. Is it possible to switch to COM before I have compiled the project to an EXE COM server? I believe the answer is No, but I am unsure.

  2. In your reply you said "it is no different than instantiating a COM object if that works. If you do it as we discussed". When I try to instantiate it as just an object rather than as a COM server, the first error is that it can not find iapplication object. The DEFINE CLASS statement is: DEFINE CLASS itfbovfeapplicationobject AS iapplication. I suppose when compiled into a COM server and so instanciating it as a COM server, it works because it found all the VFE framework files when it got compiled, but when instanciating it as non COM, it has to be able to locate all the VFE framework files and can not. Do you think that means I must include all the VFE framework files in the WC project? Is there a way that it might be able to find those VFE framework files without having to include each one of them? I ask that because the VFE framework is pretty big and there are a LOT of VCX's, etc and it will likely be a pretty big task to figure that out?

Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  Rick Strahl
  VFPJCOOK
  Oct 9, 2023 @ 07:14am
  1. No COM only works if the server is compiled for COM and registered in the registry. Otherwise COM objects can't be loaded.

  2. That's likely because you haven't established your dependencies. When you compile into an EXE/APP all SET PROCEDURE and SET CLASSLIB commands are automatically in scope but when you run as a PRG you have to explicitly load all dependencies with SET PROCEDURE TO or SET CLASSLIB TO - I'm pretty sure VFE has a way to load all that stuff with some command or loader that you may have to call before you instantiate. if not it's not difficult to set up. Again, if it works in COM it should most definitely work from FoxPro. Do it from the FoxPro command line to figure out what dependencies you have to add (or create a small test program and add the required dependencies as you go).

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 9, 2023 @ 08:02am

Rick, Thanks. That really helps. I will do as you suggest, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 9, 2023 @ 10:10am

Well, I said I would do as you suggested but obviously I do not know how. As best I can tell or find VFE has no way to load all that stuff with some command or loader. I am also pretty sure that my lack of comprehension of how set classlib, set procedure, etc along with set path at least for what I am trying to accomplish is lacking. I have the following:

SET STEP on
SET CLASSLIB TO "c:\vfe2005\ilibs\iapp.vcx" additive
This.ovfe_LPSO=NEWOBJECT("itfbovfeapplicationobject","ITFBOVFE.PRG")

Can you find the time to connect and maybe get me started with what I should be setting in order to get the object instantiated? Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  Rick Strahl
  VFPJCOOK
  Oct 9, 2023 @ 07:55pm

If you're creating a VFE desktop application, how do you ensure that VFE is loaded? It'll be the same thing. Most frameworks contain some sort of startup loader to ensure all the components needed to run are loaded.

I have some time tomorrow (Tuesday) if you need to set up another session...

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 10, 2023 @ 03:28am

Rick, That would be great. I am working on getting a zoom license. If I get that accomplished in the next 2 hours I will let you know, otherwise we can do like we did last session. Just let me know what time you are available. John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 12, 2023 @ 10:22am

Rick, I have exhausted efforts to instantiate my VFE project as non COM. I have decided to just instantiate as COM and move on. So I am instantiating my VFE project as COM from wwServer's OnLoad(). No problems there. I have code in my wwProcess endpoint that accesses the VFE Com server and locates an inmate. That all works fine in FILE Mode. I am ready to test in COM mode. I compile to an EXE. I do get errors indicating it can not find some of the framework files. I hunted down every file it wanted and now have a clean compile. To be sure I used administrator command prompt to cd \webconnectionprojects\itfbo\deploy and registered it manually itfbo.exe /regserver No errors.

I run itfbomain.prg from the VFP project manager. I go to administration. It is is FILE mode. navigate to url http://localhost/ITFBO/GetInmateInfo.ip?userid=170435&password=1234 Everything works. I see the results in the browser. I go back to administration and switch to COM mode. Navigate to the same url. I get: Unknown application error Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual:

I looked at the app pool and it is running under LocalSystem The user SYSTEM has read write to everything in c:\webconnectionprojects\itfbo and below. The user SYSTEM has read write to everything in c:\vfe2005\dev\itfbovfe and below (so to both projects folders if it matters).

I looked at itfbo.ini and the progid is itfbo.itfboserver I looked at web.config and I see ComServerProgId is itfbo.itfboserver

This is the contents of c:\webconnectionprojects\itfbo\deploy\temp\wcerrors.txt is:

2023-10-12 11:55:04.972 - 8504951885910_8 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.ComProcessor.LoadServers(Boolean initializeOnly)
   at Westwind.WebConnection.ComProcessor.ProcessRequest()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/getinmateinfo.ip?userid=00000896&password=1234
2023-10-12 11:55:45.600 - 8545597383325_5 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.WebConnectionHandler.HandleAdminTasks()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/admin/loadonecomserver.wc
2023-10-12 11:56:46.508 - 8601153161848_8 - Unable to retrieve COM Instance: Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual:  - /itfbo/admin/wc.wc?wwmaint%7eshowlog%7eError
2023-10-12 12:24:12.864 - 025285304554_7 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.ComProcessor.LoadServers(Boolean initializeOnly)
   at Westwind.WebConnection.ComProcessor.ProcessRequest()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/getinmateinfo.ip?userid=00000896&password=1234
2023-10-12 12:48:09.098 - 168908905991_7 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.ComProcessor.LoadServers(Boolean initializeOnly)
   at Westwind.WebConnection.ComProcessor.ProcessRequest()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/getinmateinfo.ip?userid=00000896&password=1234
2023-10-12 12:52:20.221 - 1940214884443_15 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.WebConnectionHandler.HandleAdminTasks()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/admin/loadonecomserver.wc
2023-10-12 12:52:59.880 - 197987030932_7 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.WebConnectionHandler.HandleAdminTasks()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/admin/loadonecomserver.wc
2023-10-12 15:21:28.533 - 088851490631_7 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.ComProcessor.LoadServers(Boolean initializeOnly)
   at Westwind.WebConnection.ComProcessor.ProcessRequest()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/getinmateinfo.ip?userid=00000896&password=1234
2023-10-12 15:21:51.651 - 090638468222_8 - Unable to retrieve COM Instance: Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual:  - /itfbo/getinmateinfo.ip?userid=170435&password=1234
2023-10-12 15:24:46.222 - 0996167620615_8 - File request timed out. - /itfbo/getinmateinfo.ip?userid=170435&password=1234
2023-10-12 15:25:52.787 - 115277268754_13 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.ComProcessor.LoadServers(Boolean initializeOnly)
   at Westwind.WebConnection.ComProcessor.ProcessRequest()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/getinmateinfo.ip?userid=170435&password=1234
2023-10-12 15:26:58.715 - 1213416486625_14 - Unable to retrieve COM Instance: Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual:  - /itfbo/getinmateinfo.ip?userid=170435&password=1234
2023-10-12 15:50:44.896 - 264488981998_36 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.ComProcessor.LoadServers(Boolean initializeOnly)
   at Westwind.WebConnection.ComProcessor.ProcessRequest()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/getinmateinfo.ip?userid=170435&password=1234
2023-10-12 15:51:40.826 - 270081626822_7 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.WebConnectionHandler.HandleAdminTasks()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/admin/loadonecomserver.wc
2023-10-12 16:06:06.136 - 3566129200611_38 - Unhandled Exception (Mainline): Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual: 
   at Westwind.WebConnection.ComServerManager.LoadServers()
   at Westwind.WebConnection.ComProcessor.LoadServers(Boolean initializeOnly)
   at Westwind.WebConnection.ComProcessor.ProcessRequest()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /itfbo/getinmateinfo.ip?userid=170435&password=1234
2023-10-12 16:19:44.876 - 4379583957757_44 - Unable to retrieve COM Instance: Invalid Com Server ProgId: Itfbo.ItfboServer - Account: SYSTEM - IIS Virtual:  - /itfbo/getinmateinfo.ip?userid=170435&password=1234

I have read everything in Docs about Dealing with Com Server Load errors. I have read every posting here about this issue. The application pool is running under SYSTEM. What should I look at next?

Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  Rick Strahl
  VFPJCOOK
  Oct 13, 2023 @ 05:25pm

Looks like the COM server is not registered. Can you load it on that machine from FoxPro using the COM ProgId?

loServer = CREATEOBJECTEX("Itfbo.ItfboServer")
? loServer.ProcessHit("...")

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 14, 2023 @ 06:31am

loServer = CREATEOBJECTEX("Itfbo.ItfboServer") I get "too few arguments".

loServer = CREATEOBJECT("Itfbo.ItfboServer") I get "Class definition ITFBO.ITFBOSERVER is not found."

I googled for how to check that a vfp exe com server is registered. I can't find anything useful.

I have other com servers. I have always registered them by opening command prompt as administrator, cd to project's home directory (where the exe is) and ITFBO.EXE /unregserver to unregister and then ITFBO.EXE /regserver to register. I did that and I do not get any messages but I also do not get any errors.

If I look in the registry, what exactly do I look for?

Just a thought. With my other COM servers, the whole application is marked OLEPUBLIC. With the WC VFP project, ONLY the ITFBO.ITFBOServer is a COM server. Do I possibly register just itfbo.itfboserver and not itfbo.exe? If so what exactly would be the command ? I tried ITFBO.ITFBOSERVER /regserver which of course does not work.

Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  Rick Strahl
  VFPJCOOK
  Oct 14, 2023 @ 06:38am

CreateObjectEx requires a machine name. Use . or localhost or 127.0.0.1.

loObj = CREATEOBJECTEX("itfboserver.itfboserver",".")

This syntax ensures that the class is created as a COM object, while plain CreateObject() in cases where the class is a FoxPro object in some cases uses the FoxPro object.

Class definition ITFBO.ITFBOSERVER is not found.

This means your COM object is not registered. If you build on the machine you're running it should register when you build. Otherwise you have to register with itfboserver.exe /regserver.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 14, 2023 @ 07:01am

OK, The desktop shortcut that WC generated did not run VFP as Administrator so when I compiled the project it did not give an error but it did not register the server (obviously). When I was registering the server manually, I was registering ITFBO.EXE and not ITFBOSERVER.EXE probably because there is no file named ITFBOSERVER.EXE.

Anyway, it is now working and running in COM mode and behaving the same as in File Mode. YEA! Onward bound... Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 16, 2023 @ 05:08am

Rick, I am on the cloud server where my WC server will run. I am following the instructions in "Deploying and Configuring West Wind Web Connection Applications". I am under the "Testing the Site" section. I did as stated "Then go to the deploy folder and launch your main EXE - Publishing.exe in this case. This starts the file based Web Server." and I see the WC server form. Next the document says to "Now navigate to your DNS location on the local machine - or any browser:" so I open Edge and navigate to http://localhost/itfbo.com and I see:

Also, If I click on the Browse button of the WC server form, I see:

Using File Explorer I noticed there is no folder named c:\inetpub\wwwroot\ITFBO if that matters. Maybe that should have been created by some of the setup as described in this document (I did as it asked) but for some reason did not occur.

Here is the Site Bindings:

Please notice, we have the Point Of Sale Website ITFOnLineStore (developed by a 3rd party and not related to foxpro), also running on this same cloud server and it has a site binding of port 80 also so perhaps that is the problem.

Thanks for any input, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  Rick Strahl
  VFPJCOOK
  Oct 16, 2023 @ 06:20am

Pretty sure either one of those Urls are not correct.

If you're running this locally on your local machine and it's working there, you need to duplicate that environment on the server.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 16, 2023 @ 07:58am

OK, I've tried my best to duplicate what is on my local machine vs what is on the server. Obviously I do not comprehend all the IIS settings and setup of a website. Can you find some time for another session and walk me thru this please.

Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 21, 2023 @ 07:44am

Rick, Well I'm 2 weeks further down this road and still no luck depolying the web service. I have tried everything I can think of. I am trying to deploy onto the server that the service will actually run on (live). Here is what I have done and the results:

I go to c:\itfbo\deploy and run itfbo.exe I see the server form that shows the requests I open browser and go to http://localhost:8080/itfbo I see: I click on either Hello World Test Page or Hello Scripting World and it times out:

If I click on Web Connection Administration I get:

c:\itfbo\deploy\itfbo.ini:

[Main]
TempFilePath=.\temp\
Template=WC_
TimerInterval=200
ScriptMode=1
logformat=3
DebugMode=On
LiveReloadEnabled=On

HomeUrl=http://localhost:8080/ITFBO

showrequestdata=Off
showserverform=On
showstatus=On


COMReleaseUrl=http://localhost:8080/ITFBO/ReleaseComServers.wc
UnattendedComMode=On
Memusage=8176

Adminemail=
Adminmailpassword=
Adminmailserver=localhost
Adminmailusername=
Adminmailusessl=Off
Adminsenderroremail=Off

# wwPdfPrinterDriver Windows 10, Server 2016
Postscriptpdfprinterdriver=Microsoft Print to PDF
# Ghostscript
# Postscriptpdfprinterdriver=Xerox PS Class Driver



[ServerConfig]
IISPath=IIS://localhost:8080/w3svc/1/root
Virtual=ITFBO
ScriptMaps=wc,wcs,md,ip

c:\itfbo\web\web.config:

<?xml version="1.0" encoding="UTF-8"?>
<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" />
		<!-- File Based -->
		<add key="TempPath" value="~\..\deploy\temp\" />
		<add key="TempFilePrefix" value="WC_" />
		<add key="AutoStartServers" value="False" />
		<!-- COM Based -->
		<add key="ComServerProgId" value="Itfbo.ItfboServer" />
		<add key="ComServerLoadingMode" value="LoadBased" />
		<add key="ServerCount" value="2" />
		<!-- Server Update Settings -->
		<add key="ExeFile" value="~\..\deploy\Itfbo.exe" />
		<add key="UpdateFile" value="~\..\deploy\Itfbo_Update.exe" />
		<!-- Administration -->
		<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" />
		<!-- Web Sockets-->
		<add key="UseWebSockets" value="False" />
		<add key="WebSocketProcessScriptmap" value="ip" />
		<!-- Live Reload Settings -->
		<add key="LiveReloadEnabled" value="True" />
		<add key="LiveReloadExtensions" value=".ip,.wc,.wcs,.html,.htm,.css,.js,.ts" />
		<add key="UseStaComServers" 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="c:\WebConnectionProjects\ITFBO\deploy\" />
		<add key="WebProjectBasePath" value="c:\WebConnectionProjects\ITFBO\Web\" />
		<add key="WebProjectVirtual" value="ITFBO" />
		<!-- Optional PRG launched when VFP IDE launches -->
		<add key="IdeOnLoadPrg" value="" />
		<!-- The editor used to edit FoxPro code - blank means FoxPro Editor is used -->
		<add key="FoxProEditorAlternate" value="%ProgramFiles%\Microsoft VS Code\Code.exe" />
	</webConnectionVisualStudio>
	<system.web>
		<!-- for Live Reload the targetFramework has to be set to at least 4.6.1 -->
		<compilation defaultLanguage="c#" targetFramework="4.6.1" />
		<!-- ASP.NET Request Limit Configuration for POST buffer and Script Timeout -->
		<httpRuntime maxRequestLength="10000000" executionTimeout="120" requestValidationMode="2.0" targetFramework="4.6.1" />
		<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
		<trust level="Full" />
        <authentication mode="Forms" />
	</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=".ip_wconnect-module" path="*.ip" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
			<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=".md_wconnect-module" path="*.md" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
		</handlers>
		<modules>
			<add name="WebConnectionModule" type="Westwind.WebConnection.WebConnectionModule,WebConnectionModule" />
		</modules>
		<defaultDocument>
			<files>
				<clear />
				<add value="default.ip" />
				<add value="Default.htm" />
				<add value="index.html" />
			</files>
		</defaultDocument>
		<directoryBrowse enabled="true" />
		<!-- 
      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="Redirect to HTTPS" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="^OFF$" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}{URL}" redirectType="SeeOther" />
        </rule>

        <rule name="Extensionless Urls" 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="UrlRewriteHandler.ip" appendQueryString="true" />
        </rule>

      </rules>
  </rewrite>
  -->
	</system.webServer>
</configuration>

c:\itfbo\web\bin\wc.ini:

[wwcgi]
;*** THIS DIRECTORY MUST HAVE READ AND WRITE ACCESS FOR THE
Path=c:\ITFBO\Deploy\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

;*** Limits the size of data posted to the Web Server
;*** In bytes. 0 means allow any size. Note: Oversize
;*** buffers result in Server 500 errors.
PostBufferLimit=0

;*** 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=ANY

;Admin Page that is used for Backlinks from various internal pages
;Use a full server relative Web path!
AdminPage=/ITFBO/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:\WCONNECT\Itfbo.exe
UpdateFile=c:\ITFBO\Deploy\TempItfbo.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

[Extra Server Variables]
;*** Add any IIS Server Variables by name
;*** Add as many VarX values as you need
;Var1=LOCAL_ADDR
;Var2=APPL_MD_PATH

[Automation Servers]
;*** 0 - Load Based, 1 - Round Robin
ServerLoading=1

;*** Specify as many servers as you want to load
Server1=Itfbo.ItfboServer
;Server2=Itfbo.ItfboServer
;Server3=Itfbo.ItfboServer

;*** 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
Exception=
Maintainance=
NoLoad=
PostBufferSize=
Timeout=
PostBufferSize=
TransmitFileFailure=

Contents of c:\itfbo\deploy folder:

Contents of c:\itfbo\web folder:

Is there anything else I can show you or would you like to connect and see if you can help me get this deployed? Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  Rick Strahl
  VFPJCOOK
  Oct 21, 2023 @ 08:51am

You're getting to Web Connection since you get a Web Connection error page.

My guess is you are in file mode and need to switch to COM mode. If In file mode you have to manually run the server. In COM (make sure server is registered) it'll auto-start.

To go to the admin page, use https://yoursite.com/itfbo/Administration.wc not the link that's on the demo page (that's pointing to an old version of the admin page that is no longer available).

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 21, 2023 @ 09:10am

OK, I'll probably need to take this one baby step at a time.

When you say "If In file mode you have to manually run the server". Exactly how do I run it "manually"? Would that be from the foxpro command window? If so , what is the verbiage?

Also, This is all only available locally meaning on the server. I do not yet have a "outside world url".

Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: Instantiation of COM server from IIS
  VFPJCOOK
  Rick Strahl
  Oct 21, 2023 @ 11:34pm

Rick, Adding to that. With regard to how to start manually, I used the VFP command window and did loserver=createobject("itfbo.itfboserver") and that ran it but when I go to http://localhost:8080/itfbo/administration.wc (just guessing here), somehow the url changes to what you see in the error message and I get the same error as before i.e. it seems to be looking for login.aspx:

Thanks, John

© 1996-2024