Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1216
  • Last Modified:

System.Runtime.InteropServices.COMException: Server request failed --> works in debug, but not from IIS

I am in the first stages of development/testing of a C# web-based app that uses third-part COM based files that make calls to the third-party server.

Test Environment includes:
XP Pro SP3
Visual Web Developer 2008

When run in debug, calls can be successfully sent/received to the third-party server via the browser.  If the same page is referenced in IIS (from the same dev box) outside of the debug environment, the following error occurs when the app attempts to connect to the 3rd party server:

System.Runtime.InteropServices.COMException: Server request failed

The stack trace info includes:
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

I've tried registering the assembly, etc., without success.
0
jsoderquist
Asked:
jsoderquist
  • 4
  • 2
2 Solutions
 
johnaryanCommented:
Could it be a permissions error? You may have to set a machine.config setting to allow the IUSER_machinename service account to use interop!

As a test, i would change the IIS user to your own username, and if it works then, you should go about adding the neccessary permissions to the IUSER account.
0
 
jsoderquistAuthor Commented:
I created a new user account, and then updated web.config to use that account
<identity impersonate="true" userName="ASPUSER" password="xxxx" />

I also added code to display the current user in order to be 100% sure.

The virtual directory that points to the dev folder has full read/write/execute permissions, and Application Protection of Low

With the current user as "ASPUSER", it continues to work fine on the development server, but the same error occurs with IIS.
0
 
jsoderquistAuthor Commented:
Further testing indicates the logon/authentication request does actually reach the third-party server under the regular IIS scenario, but fails to logon and create a session.  If a user account, password, etc. is typod the appropriate message is returned from the third party server.  However, when correct authentication info is sent the authentication request fails with the generic message of System.Runtime.InteropServices.COMException (0x80041D8F): Server request failed.

Ive hard-coded the request string for testing.  If the hard-coded authentication request is sent via the development server, it logs in and creates a session.  If sent via the IIS server, it fails.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
johnaryanCommented:
I found this quote on a forum:

"In order to do this, you have to set the ASPCompat flag at the top of
your page to true. This sets the apartment model of the thread that your
page is processed on so that it can run COM objects. Doing this in an
ASP.NET environment incurs a performance penalty though, and should be
avoided." http://bytes.com/forum/thread246333.html

Did you try changing the site to run under the Admin account to verify it's a permissions issue?
0
 
jsoderquistAuthor Commented:
The test user ASPUSER is already a member of Administrators.

FYI - the third-party server is Televantage 7.50.4817, and am using the drivers from their SDK.

When aspcompat="true" was added:
1) When tested w/ IIS the authentication request still fails.
2) When started in debug, the page start fails with the following error:

System.AccessViolationException was unhandled by user code
  Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
  Source="TVWebProj2"
  StackTrace:
       at TVWebProj2._Default.Page_Load(Object sender, EventArgs e) in C:\dev\tv\TVWebProj2\TVWebProj2\Default.aspx.vb:line 27
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException:
0
 
jsoderquistAuthor Commented:
Issue was resolved when web app was tested on Win2003 (IIS 6) after some modifications.  App will be set up to run the 2003/IIS6 box (which does the API calls to the TV server).  The web app does web services from/to other apps, essentially acting as middleware, so we should be good for now.
0
 
seju123Commented:
Can you please help me as I am having the same issue. I am trying to connect televantage server usign their sdk from Visual studio 2008 websit, and getting this error message

System.Runtime.InteropServices.COMException was unhandled by user code
  ErrorCode=-2147213937
  Message="Server request failed"
  Source="TeleVantage.Session(0x7D27460,U2777).Logon_v61"
  StackTrace:
       at TeleVantage.SessionClass.Logon(String Server, String UserName, String Password, Int32 Station, TVApplicationType ApplicationType, Int32 ApplicationID, TVServerConnectionLevel ServerConnectionLevel, Boolean CheckVersions, TVStationUsage StationUsage)    at _Default.btnCall_Click(Object sender, EventArgs e) in C:\Documents and Settings\Administrator\Desktop\WebSite1\Default.aspx.vb:line 17    at System.Web.UI.WebControls.Button.OnClick(EventArgs e)    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)    at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)    at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException:

Thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now