Solved

System.Runtime.InteropServices.COMException-->COM component with C# webservice

Posted on 2003-10-24
4
2,728 Views
Last Modified: 2011-09-20
I am trying to use COM component ( I think it was developed in c++)
in a C# webservice..
I am referrring this DLL in my project (interop & everything is fine..)...
But When I try to call a method of one class I am getting following error:

An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in system.windows.forms.dll
Additional information: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x80010105): [TempoSoftInterfaceModel.TsSession.1] Y:\TsApiFct\Src\TsSession.cpp(145) : Internal Error.
   at TempoSoftInterfaceModel.TsSessionClass.Open(String DataBase, String Serveur, String User, String PassWord, String Reserved)
   at EMPWS.Service1.sessionTest() in c:\net\testwinonweb\empws\tstws.asmx.cs:line 74
   --- End of inner exception stack trace ---
0
Comment
Question by:netvasu
4 Comments
 
LVL 9

Accepted Solution

by:
msdixon earned 50 total points
ID: 9617285
it looks like the interop component is throwing the error (Y:\TsApiFct\Src\TsSession.cpp(145)). do you have a try catch block?
0
 

Assisted Solution

by:gyani
gyani earned 50 total points
ID: 11608766
Hi,

generically speaking.....

COM will not propagate a C++ or VC++ exception from the callee to the caller,
even when both the caller and the callee are written in C++/VC++. This catches some COM newcomers off guard,
but it should be no surprise if you recall that COM is language-independent. COM boundaries are language boundaries.
For example ,

 if the caller is written in C and the callee is written in VC++/C++, what would COM do with the VC++/C++ exception?

If your code throws an exception, the caller will see a failure with an HRESULT of 0x80010105 (RPC_E_SERVERFAULT).

Interestingly enough, this is the same error the caller sees if the callee attempts an illegal memory access.

In both cases, the COM runtime isolates the caller of the object from runtime errors inside the object and presents them as server errors.

so this what ur friend has got is nothing wrong but a limitation with the interop.

tell him to wait for the next upgrade from MS, by peanuts and chill..

boss i might not have given him an exact solution but this problem is there and we have to live with it.
0

Featured Post

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.

Join & Write a Comment

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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