Solved

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

Posted on 2008-09-30
7
1,194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

622 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