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
Solved

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

Posted on 2003-10-24
4
2,767 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that undeā€¦
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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