all groups > dotnet remoting > april 2006 >
You're in the

dotnet remoting

group:

Webservice call to Remoting Singleton


Webservice call to Remoting Singleton Bill Strong
4/20/2006 6:36:01 AM
dotnet remoting: I am designing a system that uses an ASP.NET webservice to call methods on a
remoting singleton (I need the singleton to keep alive some specific COM
instances as the COM components exist and the budget to migrate them
doesn't).

I believe I either have an architecture problem or a configuration problem.
I can make one call with the webservice but any subsequent calls return a
remoting exception saying:

"Attempt to redirect activation of type 'A.S, A' which is already redirected"

I am using a configuration file and calling
RemotingConfiguration.Configure(web.config) either in the webservice
constructor or in the particular method being called prior to calling the
singleton method. I assume there is something wrong with this approach but
can find no reference on how to setup the remoting connection in this
situation. Is there another way I should be using to get the remoting system
up and running? I've been assuming that the webservice is starting fresh with
each call but apparently that is not the case.

Any help would be most appreciated.

Thanks,
Bill Strong
RE: Webservice call to Remoting Singleton David C
4/20/2006 6:03:01 PM
Hi Bill,

Initialise the remoting configuration in the Application_Start method in the
global.asax rather than in every method call.

DC

[quoted text, click to view]
RE: Webservice call to Remoting Singleton Bill Strong
4/21/2006 6:05:02 AM
Hi David,

Great! I added a Global.asmx file to my project, added the following
directive to the top of the file:

<%@ Import Namespace="System.Runtime.Remoting" %>

and called RemotingConfiguration.Configure(webconfig_path & filename) in the
Application_Start subroutine and it seems to work fine.

A workaround I came up with prior to receiving your reply was to check
ChannelServices.RegisteredChannels.Length < 1 in the Sub New() and if true,
call RemotingConfig. Your suggestion of course is much better.

Thanks again,
Bill

[quoted text, click to view]
AddThis Social Bookmark Button