Solved

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

Posted on 2008-09-30
7
1,161 Views
Last Modified: 2012-06-27
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
Comment
Question by:jsoderquist
  • 4
  • 2
7 Comments
 
LVL 5

Assisted Solution

by:johnaryan
johnaryan earned 125 total points
ID: 22609222
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
 

Author Comment

by:jsoderquist
ID: 22616079
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
 

Author Comment

by:jsoderquist
ID: 22618819
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 5

Expert Comment

by:johnaryan
ID: 22622464
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
 

Author Comment

by:jsoderquist
ID: 22625676
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
 

Accepted Solution

by:
jsoderquist earned 0 total points
ID: 22672976
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
 

Expert Comment

by:seju123
ID: 33420448
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now