Web Connection
XML files on com server
Gravatar is a globally recognized avatar based on your email address. XML files on com server
  Josh
  All
  May 18, 2015 @ 10:08am
Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh


Josh

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Rick Strahl
  Josh
  May 18, 2015 @ 11:49am
You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh




Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Josh
  Rick Strahl
  Jun 24, 2015 @ 04:47am
Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh





Josh

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Josh
  Josh
  Jun 24, 2015 @ 04:48am

Application pool


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh






Josh

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Josh
  Josh
  Jun 24, 2015 @ 04:49am


Application pool


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh







Josh

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Rick Strahl
  Josh
  Jun 24, 2015 @ 07:58am
Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh





Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Josh
  Rick Strahl
  Jun 24, 2015 @ 10:28am
Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh







Josh

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Rick Strahl
  Josh
  Jun 24, 2015 @ 10:37am

Well the server is loading it's just never getting past the init because it's failing on the drive mappings/network access.

I'm not sure what the solution is but the server is in fact loading. I would think mapping a drive would work, but maybe it's a permissions problem you can't just map the drive like that I believe - you need to specify username and password.

+++ Rick ---


Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh








Rick Strahl
West Wind Technologies

Making waves on the Web
from Hood River

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Josh
  Rick Strahl
  Jun 26, 2015 @ 04:59am
Created a mapping script in the "Local Computer Policy/Windows Setting/Scripts/Startup" on my Windows2012 server and the com server is now working. Thanks for your help.

Josh


Well the server is loading it's just never getting past the init because it's failing on the drive mappings/network access.

I'm not sure what the solution is but the server is in fact loading. I would think mapping a drive would work, but maybe it's a permissions problem you can't just map the drive like that I believe - you need to specify username and password.

+++ Rick ---


Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh









Josh

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Rick Strahl
  Josh
  Jun 26, 2015 @ 08:00am
Can you share your script? This might be a good thing for others to know about.

+++ Rick ---



Created a mapping script in the "Local Computer Policy/Windows Setting/Scripts/Startup" on my Windows2012 server and the com server is now working. Thanks for your help.

Josh


Well the server is loading it's just never getting past the init because it's failing on the drive mappings/network access.

I'm not sure what the solution is but the server is in fact loading. I would think mapping a drive would work, but maybe it's a permissions problem you can't just map the drive like that I believe - you need to specify username and password.

+++ Rick ---


Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh











Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Josh
  Rick Strahl
  Jun 26, 2015 @ 08:08am
Here you go...

@echo off

net use G: /delete /yes
net use J: /delete /yes
net use Q: /delete /yes

net use G: \\nas\data\Progs /USER:DOMAIN\user password /persistent:yes
net use J: \\nas\data\WebData /USER:DOMAIN\user password /persistent:yes
net use Q: \\scosysv\quotesunix /USER:DOMAIN\user password /persistent:yes

Put this in a protected folder... Domain, User name and password in a text file probably not the best idea...
Any suggestions would be welcome.

Josh



Can you share your script? This might be a good thing for others to know about.

+++ Rick ---



Created a mapping script in the "Local Computer Policy/Windows Setting/Scripts/Startup" on my Windows2012 server and the com server is now working. Thanks for your help.

Josh


Well the server is loading it's just never getting past the init because it's failing on the drive mappings/network access.

I'm not sure what the solution is but the server is in fact loading. I would think mapping a drive would work, but maybe it's a permissions problem you can't just map the drive like that I believe - you need to specify username and password.

+++ Rick ---


Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh












Josh

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Rick Strahl
  Josh
  Jun 28, 2015 @ 03:56pm
Josh,

I know you got this working but could you see if you can get the following to work (which is built into Web Connection) into the Server's YourServer::OnInit() code:

mapnetworkdrive("i:","\\RASXPS\CDrive","username","password")
IF (!IsDir("i:\temp")) && point at some known path or file
this.Trace("i: drive was not mapped...")
ENDIF

You'd want to do this as early as possible in your startup code and before anything else is fired. If the connection is slow you might want to increase the timeout a little if you are loading data as part of your server initialization.

I don't have a good repro scenario here as all the machines are running hte same accounts so I can log on easily anywhere without passwords, but if it explicitly use invalid passwords it definitely fails.

I just think it's probably cleaner if the application can set its own mapping rather than relying on an external mapping from the OS startup.


Here's a slightly updated version that includes the persistent parameter option:

************************************************************************
* MapNetworkDrive
****************************************
*** Function: Maps a network drive
*** Assume:
*** Pass: lcDrive - i:
*** lcSharePath - UNC path to map \\server\share
*** lcUsername - user name (if empty uses current creds)
*** lcPassword - password
*** Return: nothing
************************************************************************

FUNCTION MapNetworkDrive(lcDrive, lcSharePath, lcUsername, lcPassword)

IF RIGHT(lcDrive,1) != ":"
lcDrive = lcDrive + ":"
ENDIF

lcRun = [net use ] + lcDrive + [ "] + lcSharePath + [" ]

IF !EMPTY(lcUsername)
lcUserName = ["] + lcPassword + [" /USER:"] + lcUsername + ["]
ELSE
lcUserName = ""
ENDIF

lcUsername = lcUserName + " /persistent:yes"

lcRun = lcRun + lcUsername
RUN &lcRun

ENDFUNC
* MapNetworkDrive


+++ Rick ---



Here you go...

@echo off

net use G: /delete /yes
net use J: /delete /yes
net use Q: /delete /yes

net use G: \\nas\data\Progs /USER:DOMAIN\user password /persistent:yes
net use J: \\nas\data\WebData /USER:DOMAIN\user password /persistent:yes
net use Q: \\scosysv\quotesunix /USER:DOMAIN\user password /persistent:yes

Put this in a protected folder... Domain, User name and password in a text file probably not the best idea...
Any suggestions would be welcome.

Josh



Can you share your script? This might be a good thing for others to know about.

+++ Rick ---



Created a mapping script in the "Local Computer Policy/Windows Setting/Scripts/Startup" on my Windows2012 server and the com server is now working. Thanks for your help.

Josh


Well the server is loading it's just never getting past the init because it's failing on the drive mappings/network access.

I'm not sure what the solution is but the server is in fact loading. I would think mapping a drive would work, but maybe it's a permissions problem you can't just map the drive like that I believe - you need to specify username and password.

+++ Rick ---


Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh














Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Josh
  Rick Strahl
  Jul 1, 2015 @ 03:01am
Rick,

Your code uses Webconnect v5.72. I have 5.70 which we purchased in November 2014.
I downloaded the shareware version of 5.72 but need the production version.
Not sure how to go about doing that...

Thanks,

Josh



Josh,

I know you got this working but could you see if you can get the following to work (which is built into Web Connection) into the Server's YourServer::OnInit() code:

mapnetworkdrive("i:","\\RASXPS\CDrive","username","password")
IF (!IsDir("i:\temp")) && point at some known path or file
this.Trace("i: drive was not mapped...")
ENDIF

You'd want to do this as early as possible in your startup code and before anything else is fired. If the connection is slow you might want to increase the timeout a little if you are loading data as part of your server initialization.

I don't have a good repro scenario here as all the machines are running hte same accounts so I can log on easily anywhere without passwords, but if it explicitly use invalid passwords it definitely fails.

I just think it's probably cleaner if the application can set its own mapping rather than relying on an external mapping from the OS startup.


Here's a slightly updated version that includes the persistent parameter option:

************************************************************************
* MapNetworkDrive
****************************************
*** Function: Maps a network drive
*** Assume:
*** Pass: lcDrive - i:
*** lcSharePath - UNC path to map \\server\share
*** lcUsername - user name (if empty uses current creds)
*** lcPassword - password
*** Return: nothing
************************************************************************

FUNCTION MapNetworkDrive(lcDrive, lcSharePath, lcUsername, lcPassword)

IF RIGHT(lcDrive,1) != ":"
lcDrive = lcDrive + ":"
ENDIF

lcRun = [net use ] + lcDrive + [ "] + lcSharePath + [" ]

IF !EMPTY(lcUsername)
lcUserName = ["] + lcPassword + [" /USER:"] + lcUsername + ["]
ELSE
lcUserName = ""
ENDIF

lcUsername = lcUserName + " /persistent:yes"

lcRun = lcRun + lcUsername
RUN &lcRun

ENDFUNC
* MapNetworkDrive


+++ Rick ---



Here you go...

@echo off

net use G: /delete /yes
net use J: /delete /yes
net use Q: /delete /yes

net use G: \\nas\data\Progs /USER:DOMAIN\user password /persistent:yes
net use J: \\nas\data\WebData /USER:DOMAIN\user password /persistent:yes
net use Q: \\scosysv\quotesunix /USER:DOMAIN\user password /persistent:yes

Put this in a protected folder... Domain, User name and password in a text file probably not the best idea...
Any suggestions would be welcome.

Josh



Can you share your script? This might be a good thing for others to know about.

+++ Rick ---



Created a mapping script in the "Local Computer Policy/Windows Setting/Scripts/Startup" on my Windows2012 server and the com server is now working. Thanks for your help.

Josh


Well the server is loading it's just never getting past the init because it's failing on the drive mappings/network access.

I'm not sure what the solution is but the server is in fact loading. I would think mapping a drive would work, but maybe it's a permissions problem you can't just map the drive like that I believe - you need to specify username and password.

+++ Rick ---


Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh















Josh

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Rick Strahl
  Rick Strahl
  Jul 1, 2015 @ 07:35am
Josh,

THe code below is not in any shipping version - the method exists in wwAPI, but it's been updated to include the /persistent flag which is required to make this work. You can just replace this function for the one that exists in wwapi.prg.

If you need to get the latest version send me a private email and I'll send you the link for the latest version. You should be on the update list to get notified when new releases are coming out.

+++ Rick ---



Josh,

Shouldn't matter. The code below is newer than what's in any shipped version.

If you need to update to the latest version send me a private email and I'll send you an update link.

+++ Rick ---



Rick,

Your code uses Webconnect v5.72. I have 5.70 which we purchased in November 2014.
I downloaded the shareware version of 5.72 but need the production version.
Not sure how to go about doing that...

Thanks,

Josh



Josh,

I know you got this working but could you see if you can get the following to work (which is built into Web Connection) into the Server's YourServer::OnInit() code:

mapnetworkdrive("i:","\\RASXPS\CDrive","username","password")
IF (!IsDir("i:\temp")) && point at some known path or file
this.Trace("i: drive was not mapped...")
ENDIF

You'd want to do this as early as possible in your startup code and before anything else is fired. If the connection is slow you might want to increase the timeout a little if you are loading data as part of your server initialization.

I don't have a good repro scenario here as all the machines are running hte same accounts so I can log on easily anywhere without passwords, but if it explicitly use invalid passwords it definitely fails.

I just think it's probably cleaner if the application can set its own mapping rather than relying on an external mapping from the OS startup.


Here's a slightly updated version that includes the persistent parameter option:

************************************************************************
* MapNetworkDrive
****************************************
*** Function: Maps a network drive
*** Assume:
*** Pass: lcDrive - i:
*** lcSharePath - UNC path to map \\server\share
*** lcUsername - user name (if empty uses current creds)
*** lcPassword - password
*** Return: nothing
************************************************************************

FUNCTION MapNetworkDrive(lcDrive, lcSharePath, lcUsername, lcPassword)

IF RIGHT(lcDrive,1) != ":"
lcDrive = lcDrive + ":"
ENDIF

lcRun = [net use ] + lcDrive + [ "] + lcSharePath + [" ]

IF !EMPTY(lcUsername)
lcUserName = ["] + lcPassword + [" /USER:"] + lcUsername + ["]
ELSE
lcUserName = ""
ENDIF

lcUsername = lcUserName + " /persistent:yes"

lcRun = lcRun + lcUsername
RUN &lcRun

ENDFUNC
* MapNetworkDrive


+++ Rick ---



Here you go...

@echo off

net use G: /delete /yes
net use J: /delete /yes
net use Q: /delete /yes

net use G: \\nas\data\Progs /USER:DOMAIN\user password /persistent:yes
net use J: \\nas\data\WebData /USER:DOMAIN\user password /persistent:yes
net use Q: \\scosysv\quotesunix /USER:DOMAIN\user password /persistent:yes

Put this in a protected folder... Domain, User name and password in a text file probably not the best idea...
Any suggestions would be welcome.

Josh



Can you share your script? This might be a good thing for others to know about.

+++ Rick ---



Created a mapping script in the "Local Computer Policy/Windows Setting/Scripts/Startup" on my Windows2012 server and the com server is now working. Thanks for your help.

Josh


Well the server is loading it's just never getting past the init because it's failing on the drive mappings/network access.

I'm not sure what the solution is but the server is in fact loading. I would think mapping a drive would work, but maybe it's a permissions problem you can't just map the drive like that I believe - you need to specify username and password.

+++ Rick ---


Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh


















Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Josh
  Rick Strahl
  Jul 8, 2015 @ 08:50am
Hi Rick:

Managed to work on your script and had to make a few changes to make it work.
Changes were 1)spaces between drive and path. 2) User name and password were reversed 3) took out all the quote marks

Thanks again for your help.

See you in October for the training in Arizona.

Josh

mapnetworkdrive("J","\\nas\data\webdata","DOMAIN\MyUserName","MyPassword")


************************************************************************
* MapNetworkDrive
****************************************
*** Function: Maps a network drive
*** Assume:
*** Pass: lcDrive - i:
*** lcSharePath - UNC path to map \\server\share
*** lcUsername - user name (if empty uses current creds)
*** lcPassword - password
*** Return: nothing
************************************************************************

FUNCTION MapNetworkDrive(lcDrive, lcSharePath, lcUsername, lcPassword)

IF RIGHT(lcDrive,1) != ":"
lcDrive = lcDrive + ":"
ENDIF

lcRun = [net use ] + lcDrive + " " + lcSharePath

IF !EMPTY(lcUsername)
lcUserName = [ /USER:] + lcUserName + " " + lcPassword
ELSE
lcUserName = ""
ENDIF

lcUsername = lcUserName + " /persistent:yes"

lcRun = lcRun + lcUsername

RUN &lcRun

ENDFUNC
* MapNetworkDrive



Josh,

I know you got this working but could you see if you can get the following to work (which is built into Web Connection) into the Server's YourServer::OnInit() code:

mapnetworkdrive("i:","\\RASXPS\CDrive","username","password")
IF (!IsDir("i:\temp")) && point at some known path or file
this.Trace("i: drive was not mapped...")
ENDIF

You'd want to do this as early as possible in your startup code and before anything else is fired. If the connection is slow you might want to increase the timeout a little if you are loading data as part of your server initialization.

I don't have a good repro scenario here as all the machines are running hte same accounts so I can log on easily anywhere without passwords, but if it explicitly use invalid passwords it definitely fails.

I just think it's probably cleaner if the application can set its own mapping rather than relying on an external mapping from the OS startup.


Here's a slightly updated version that includes the persistent parameter option:

************************************************************************
* MapNetworkDrive
****************************************
*** Function: Maps a network drive
*** Assume:
*** Pass: lcDrive - i:
*** lcSharePath - UNC path to map \\server\share
*** lcUsername - user name (if empty uses current creds)
*** lcPassword - password
*** Return: nothing
************************************************************************

FUNCTION MapNetworkDrive(lcDrive, lcSharePath, lcUsername, lcPassword)

IF RIGHT(lcDrive,1) != ":"
lcDrive = lcDrive + ":"
ENDIF

lcRun = [net use ] + lcDrive + [ "] + lcSharePath + [" ]

IF !EMPTY(lcUsername)
lcUserName = ["] + lcPassword + [" /USER:"] + lcUsername + ["]
ELSE
lcUserName = ""
ENDIF

lcUsername = lcUserName + " /persistent:yes"

lcRun = lcRun + lcUsername
RUN &lcRun

ENDFUNC
* MapNetworkDrive


+++ Rick ---



Here you go...

@echo off

net use G: /delete /yes
net use J: /delete /yes
net use Q: /delete /yes

net use G: \\nas\data\Progs /USER:DOMAIN\user password /persistent:yes
net use J: \\nas\data\WebData /USER:DOMAIN\user password /persistent:yes
net use Q: \\scosysv\quotesunix /USER:DOMAIN\user password /persistent:yes

Put this in a protected folder... Domain, User name and password in a text file probably not the best idea...
Any suggestions would be welcome.

Josh



Can you share your script? This might be a good thing for others to know about.

+++ Rick ---



Created a mapping script in the "Local Computer Policy/Windows Setting/Scripts/Startup" on my Windows2012 server and the com server is now working. Thanks for your help.

Josh


Well the server is loading it's just never getting past the init because it's failing on the drive mappings/network access.

I'm not sure what the solution is but the server is in fact loading. I would think mapping a drive would work, but maybe it's a permissions problem you can't just map the drive like that I believe - you need to specify username and password.

+++ Rick ---


Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh















Josh

Gravatar is a globally recognized avatar based on your email address. Re: XML files on com server
  Rick Strahl
  Josh
  Jul 8, 2015 @ 02:11pm
Hmmm... the quotes should not matter and you need that in case paths have spaces in them. I had made some changes myself and here is the code I have for this now.

************************************************************************
* MapNetworkDrive
****************************************
*** Function: Maps a network drive by shelling out
*** Assume:
*** Pass: lcDrive - i:
*** lcSharePath - UNC path to map \\server\share
*** lcUsername - user name (if empty uses current creds)
*** lcPassword - password
*** Return: nothing
************************************************************************

FUNCTION MapNetworkDrive(lcDrive, lcSharePath, lcUsername, lcPassword)

IF RIGHT(lcDrive,1) != ":"
lcDrive = lcDrive + ":"
ENDIF

lcRun = [net use ] + lcDrive + [ "] + lcSharePath + [" ]

IF !EMPTY(lcUsername)
lcUserName = ["] + lcPassword + [" /USER:"] + lcUsername + ["]
ELSE
lcUserName = ""
ENDIF

lcUsername = lcUserName + " /persistent:yes"

lcRun = lcRun + lcUsername
RUN &lcRun

*** Check to see if the folder exists now
RETURN DIRECTORY(lcDrive)
ENDFUNC
* MapNetworkDrive

This works for me mapping drives across the network here...

+++ Rick ---



Hi Rick:

Managed to work on your script and had to make a few changes to make it work.
Changes were 1)spaces between drive and path. 2) User name and password were reversed 3) took out all the quote marks

Thanks again for your help.

See you in October for the training in Arizona.

Josh

mapnetworkdrive("J","\\nas\data\webdata","DOMAIN\MyUserName","MyPassword")


************************************************************************
* MapNetworkDrive
****************************************
*** Function: Maps a network drive
*** Assume:
*** Pass: lcDrive - i:
*** lcSharePath - UNC path to map \\server\share
*** lcUsername - user name (if empty uses current creds)
*** lcPassword - password
*** Return: nothing
************************************************************************

FUNCTION MapNetworkDrive(lcDrive, lcSharePath, lcUsername, lcPassword)

IF RIGHT(lcDrive,1) != ":"
lcDrive = lcDrive + ":"
ENDIF

lcRun = [net use ] + lcDrive + " " + lcSharePath

IF !EMPTY(lcUsername)
lcUserName = [ /USER:] + lcUserName + " " + lcPassword
ELSE
lcUserName = ""
ENDIF

lcUsername = lcUserName + " /persistent:yes"

lcRun = lcRun + lcUsername

RUN &lcRun

ENDFUNC
* MapNetworkDrive



Josh,

I know you got this working but could you see if you can get the following to work (which is built into Web Connection) into the Server's YourServer::OnInit() code:

mapnetworkdrive("i:","\\RASXPS\CDrive","username","password")
IF (!IsDir("i:\temp")) && point at some known path or file
this.Trace("i: drive was not mapped...")
ENDIF

You'd want to do this as early as possible in your startup code and before anything else is fired. If the connection is slow you might want to increase the timeout a little if you are loading data as part of your server initialization.

I don't have a good repro scenario here as all the machines are running hte same accounts so I can log on easily anywhere without passwords, but if it explicitly use invalid passwords it definitely fails.

I just think it's probably cleaner if the application can set its own mapping rather than relying on an external mapping from the OS startup.


Here's a slightly updated version that includes the persistent parameter option:

************************************************************************
* MapNetworkDrive
****************************************
*** Function: Maps a network drive
*** Assume:
*** Pass: lcDrive - i:
*** lcSharePath - UNC path to map \\server\share
*** lcUsername - user name (if empty uses current creds)
*** lcPassword - password
*** Return: nothing
************************************************************************

FUNCTION MapNetworkDrive(lcDrive, lcSharePath, lcUsername, lcPassword)

IF RIGHT(lcDrive,1) != ":"
lcDrive = lcDrive + ":"
ENDIF

lcRun = [net use ] + lcDrive + [ "] + lcSharePath + [" ]

IF !EMPTY(lcUsername)
lcUserName = ["] + lcPassword + [" /USER:"] + lcUsername + ["]
ELSE
lcUserName = ""
ENDIF

lcUsername = lcUserName + " /persistent:yes"

lcRun = lcRun + lcUsername
RUN &lcRun

ENDFUNC
* MapNetworkDrive


+++ Rick ---



Here you go...

@echo off

net use G: /delete /yes
net use J: /delete /yes
net use Q: /delete /yes

net use G: \\nas\data\Progs /USER:DOMAIN\user password /persistent:yes
net use J: \\nas\data\WebData /USER:DOMAIN\user password /persistent:yes
net use Q: \\scosysv\quotesunix /USER:DOMAIN\user password /persistent:yes

Put this in a protected folder... Domain, User name and password in a text file probably not the best idea...
Any suggestions would be welcome.

Josh



Can you share your script? This might be a good thing for others to know about.

+++ Rick ---



Created a mapping script in the "Local Computer Policy/Windows Setting/Scripts/Startup" on my Windows2012 server and the com server is now working. Thanks for your help.

Josh


Well the server is loading it's just never getting past the init because it's failing on the drive mappings/network access.

I'm not sure what the solution is but the server is in fact loading. I would think mapping a drive would work, but maybe it's a permissions problem you can't just map the drive like that I believe - you need to specify username and password.

+++ Rick ---


Rick,

The server gets fired up. The first thing it does after that is open up data files that it expects to see a drive mapping that as you accurately described it no longer sees.

I change the table dictionary file (tabldict) from drive mapping (J:\Master\) to a unc (\\nas\data\webdata) then it takes forever to load and the app times out before it can access data.

If I try and set a drive mapping script such as:
oWshNetwork = CreateObject("WScript.Network")
oWshNetwork.MapNetworkDrive( "J:", \\nas\datawebdata)

the server "fails to load" altogether.

Your thoughts?

Thanks,

Josh



Josh,

You should never use the Interactive User for a live application. As you point out it only works with a logged on console and that's no good on a server (for lots of reasons - security, auto-logoff, screen lockout).

The proper way to do security is as follows:

Configure your Application Pool to the user account that has the rights that you will need. Looks like you've done that with the Administrator account.

Leave DCOMCNFG alone - the default for COM objects is 'Launching User' which will be the Application Pool account. If you have interactive user set now, go back and remove that and set the Identity to Launching User which will inherit whatever the AppPool is running under. You might want to change the Launch and Access permissions and make sure that the user the AppPool is using has Launch and Access rights.

Now - that should just work - assuming the account you are using has the rights you need.

Note there may be other complications like network shares not being visible (they won't be because you're creating a new user session so you have to map any drives as part of your application or use UNC paths). If it doesn't work check your Windows process list and see if the EXE is showing up in the list. If it is and nothing is happening it's possible the server hung during startup - most likely due to an error in the startup code.

If you're using the latest version of Web Connection you can also check the request log and trace file (wwTraceLog.txt) for any errors that occurred in your server. You can also add some trace code to your server in YourServer::OnInit() to check and see if your code actually ever gets fired at all. From within the server code you can use:

this.Trace("Made it into OnInit")

+++ Rick ---


Hi Rick:

Managed to get the com server working but only as the interactive user. This causes problems because the server gets logged off at night and does not come back up until we log in. We ping it every 15 minutes but it still knocks us out.

I included pictures of the application pool, dcom config page(the object is crmserver.crmserverserver), the ini file, the module status page.

The application pool is set to administrator.

The ini file is:

[Main]
TempFilePath=C:\temp\wc\
Template=WC_
TimerInterval=200
LogToFile=On
ShowStatus=On
ShowServerForm=On
SaveRequestFiles=Off
UseMTS=Off
COMReleaseUrl="http://localhost/crmserver/wc.wc?_maintain~release"
[automation Servers]
KeepAlive=1

My web.config page is:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="webConnectionVisualStudio" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionConfiguration" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webConnectionErrorPages" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
<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:\wconnect\" />
<add key="WebProjectBasePath" value="C:\inetpub\wwwroot\crmserver\" />
<add key="WebProjectVirtual" value="http://localhost/crmserver" />
<!-- 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 (x86)\pspad editor\pspad.exe" />
</webConnectionVisualStudio>
<webConnectionConfiguration>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Timeout" value="90" />
<add key="PostBufferLimit" value="0" />
<add key="TempPath" value="C:\temp\wc\" />
<add key="TempFilePrefix" value="WC_" />
<add key="MessagingMechanism" value="Com" />
<add key="AdminAccount" value="ANY" />
<add key="AdminPage" value="/wwThreads/admin/admin.aspx" />
<add key="ExeFile" value="c:\wconnect\crmserver.exe" />
<add key="UpdateFile" value="" />
<add key="LogDetail" value="False" />
<add key="ValidateRequest" value="False" />
<add key="ComServerProgId" value="crmserver.crmserverServer" />
<add key="ComServerLoadingMode" value="LoadBased" />
<add key="ServerCount" value="2" />
<add key="AutoStartServers" value="False" />
<add key="MessageDisplayFooter" value="Message generated by Web Connection IIS Connector Module" />
<add key="UseCustomManifestLoading" value="False" />
<add key="AuthenticationMode" value="Default" />
<add key="PassAspNetContext" value="False" />
</webConnectionConfiguration>
<webConnectionErrorPages>
<!-- NOTE: These settings apply only to the Web Connection Managed Module! -->
<add key="Exception" value="" />
<add key="OleError" value="" />
<add key="Timeout" value="" />
<add key="NoOutput" value="" />
<add key="Busy" value="" />
<add key="Maintenance" value="" />
<add key="InvalidRequestId" value="" />
<add key="TranmitFileFailure" value="" />
<add key="PostBufferSize" value="" />
</webConnectionErrorPages>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<!-- Build Providers enable your script extensions to be editable in Visual Studio -->
<buildProviders>
<add extension=".wcsx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".wc" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".pac" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<!-- Web Connection Managed Module requires that it runs in FULL TRUST (COM Interop) -->
<trust level="Full" />
<httpHandlers>
</httpHandlers>
</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=".pac_wconnect-module" path="*.pac" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
<add name=".wwsoap_wconnect-module" path="*.wwsoap" 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=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" />
</handlers>
<!--
EXTENSIONLESS URL HANDLING
- Requires IIS Url Rewrite Module 2.0 (Web Platform Installer)
-->
<!--
<rewrite>
<rules>
<rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="UrlRewriteHandler.pac" appendQueryString="true" />
</rule>
</rules>
</rewrite>
-->
</system.webServer>
</configuration>


Thanks,
Josh


You're going to have to provide more info. What's the error when you fail? If you're hanging it sounds like you're running in Debug mode or you don't have COM non-interactive mode enabled. If it bombs for whatever reason you may end up with a dialog that hangs the server.

Also keep in mind that your COM server may run under different security than your standalone EXE. If you didn't configure DCOMCNFG (and you shouldn't) the COM server will run under the security context of the IIS Application Pool that hosts your Web app. Make sure that account has the rights needed to access files on disk and any other resources. If you don't - file access errors ensue and if you are in COM mode without SYS(2335) set your server will show a hidden file open box and hang.


Check out the documentation on COM to see the few extra steps you should take for COM servers specifically around setting UnattendedMode in the configuration or explicitly setting SYS(2335,0) in your process classes.

+++ Rick ---



Just turned on WC 5.70 . When running under file based mode everything works.

When running under Com mode the HelloWorld test page comes up OK but when I try to send the business object XML file the server hangs.

The Url is: http://localhost/ctlserve5/getallctl.pac5?

Output under file mode works and is:

What am I doing wrong?

Thanks,

Josh
















© 1996-2024