Web Service Calling a COM object-throws exception.

C

Chris Bardon

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?
 
M

Michelle Hlaing

--------------------
From: (e-mail address removed) (Chris Bardon)
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices,microsoft.public.dotnet.framework.webservices
Subject: Web Service Calling a COM object-throws exception.
Date: 8 Jun 2004 13:21:33 -0700
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?
Hi,

What platform are you running on?
Do you have more details with the error that you are seeing or is that all?
Are you trying to access either the Request or response object during the 2nd request?
Are your COM ojects nested?
Have you tried running a Netmon trace to figure out where the point of error might be?

Hope that helps,

Michelle

***Disclaimer: This posting is provided "as is" with no warranties and confers no rights.***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top