[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Web Service Calling a COM object-throws exception.

(Chris Bardon)

7/22/2004 2:06:00 AM

I'm trying to write a web service that calls a COM object located on
the same machine as the web server, and I'm running into a strange
problem. First off, here's the webMethod Code:
[WebMethod] public int LogonAgent()
{
try
{
RSPSLib.RSPSComObjClass r=new RSPSLib.RSPSComObjClass();
r.LogonAgent(1000,123,1,0);
}
catch(System.Exception e)
{
Debug.Write(e.ToString());
}
}

When I run this, I catch the exception "The object invoked has
disconnected from its clients." when I call the method. I placed the
same code in a windows forms app, and it worked fine, so I'm thinking
it has something to do with the web service.

Now, the other strange thing about this object is that it's running as
a Singleton, since I'm using it to maintain a single persistent TCP
connection in a windows service. I'm guessing that it has something
to do with the web service seing (but not having access to) the
running process (and therefore the COM object), but I'm really not
sure about anything here. Has anyone run into a similar problem with
COM and Web Services?