I was already using Activator, but I figured out that you might be suggesting that I don't have to call
RegisterWellKnownClientType and upon more carefull reading, the doc says that RegisterWellKnownClientType is not needed if you use
I removed the call to RegisterWellKnownClientType and all appears to works now.
On Wed, 29 Jun 2005 19:03:59 -0400, "Cordell Lawrence" <clawrence@teleios-systems.com> wrote:
>Hey Roy,
>Try using the Activator.GetObject( Type type, string url ) to remote SOA
>objects that are running on specific machines.
>
>so ...
>
>// Untested verified code
>
>{
>...
>remoteServerUri1 = new UriBuilder( ... );
>remoteServerUri2 = new UriBuilder( ... );
>
>// Use / get (a proxy to) an object running on Server1
>MyRemoteObject objOnServer1
> = (MyRemoteObject)Activator.GetObject( typeof ( MyRemoteObject ),
>remoteServerUri1.Uri.AbsoluteUri);
>
>// Use / get (a proxy to) an object running on Server2
>MyRemoteObject objOnServer2
> = (MyRemoteObject)Activator.GetObject( typeof ( MyRemoteObject ),
>remoteServerUri2.Uri.AbsoluteUri);
>
>...
>}
>
>Hope this helps
>Cordell Lawrence
>Teleios Systems Ltd.
>
>"Roy Chastain" <roy@kmsys.com> wrote in message
>news:jos5c11etulujepid6e6hphn0cq8b23j2n@4ax.com...
>> I have a service that provides a singleton SAO. I can be running this
>service on more than one system at a time.
>> I have an application that attempts to use the singleton via remoting.
>The idea was that this application could connect to more
>> than one instance (machine) of the service at one time. The code below
>was my attempt. Each time the code is called the
>> 'server_name' parameter to the UriBuilder is different.
>>
>> uri_builder = new
>UriBuilder("TCP",server_name,remote_port,"HGSMonitoring/RemotingManager.rem"
>);
>> client_type_entry = new
>WellKnownClientTypeEntry(typeof(RemotingManagerBase),uri_builder.Uri.Absolut
>eUri);
>>
>RemotingConfiguration.RegisterWellKnownClientType(client_type_entry);
>>
>> Unfortunately this does not work.
>> The RegisterWellKnownClientType call throws the following exception.
>> Attempt to redirect activation of type
>'KMS.Core.Remoting.Shared.RemotingManagerBase, RemotingSharedBase' which is
>already
>> redirected.
>>
>> In retrospect this makes some sense, but since it is activated using the
>URI, i still think that it should work.
>>
>> Anyway, the bottom line is.
>>
>> Is there any REASONABLE way to allow one application to use remoting to
>use the same SAO Singleton on different machines (or
>> actually URIs in this case) at the same time?
>>
>>
>>
>> -------------------------------------------
>> Roy Chastain
>> KMSYS Worldwide, Inc.
>>
http://www.kmsys.com >