unregister ActivatedClientType

  • Thread starter Thread starter Ricky Jones
  • Start date Start date
R

Ricky Jones

Is there any way to unregister a ActivatedClientType?
thanks, Ricky Jones
 
Hi Ricky,

I do not think you can unregister an ActivatedClientTypeEntry after you
have registered it in the remoting config.
Can you tell me what you want to do?

Here is link, you may have a check and let me know if that is what you want
to do.
http://groups.google.com/groups?hl=zh-CN&lr=&ie=UTF-8&oe=UTF-8&threadm=u6aPe
69hCHA.1392%40tkmsftngp12&rnum=2&prev=/groups%3Fhl%3Dzh-CN%26lr%3D%26ie%3DUT
F-8%26oe%3DUTF-8%26q%3DActivatedClientTypeEntry%2Band%2Bunregister

I look forward to hearing from you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
 
Thanks, for responding,

I accept a servername from the user, then I register an ActivatedClientType
to connect to the server. If you are unable to connect to the server it will
allow the user to reenter the servername. At this point though you cannot
reregister the type to point to the new server location. I've started
looking into using the activator class, but that seems to only work for
wellknowclienttypes not activatedclienttypes.

I looked at the article you sent me, it seems as though that is if the
object is already created.

Also note I'm setting up the remoting configuration through code.

Thank You

Ricky Jones

H&A Scientific Inc.
 
Thanks, for responding,

I accept a servername from the user, then I register an ActivatedClientType
to connect to the server. If you are unable to connect to the server it will
allow the user to reenter the servername. At this point though you cannot
reregister the type to point to the new server location. I've started
looking into using the activator class, but that seems to only work for
wellknowclienttypes not activatedclienttypes.

I looked at the article you sent me, it seems as though that is if the
object is already created.

Also note I'm setting up the remoting configuration through code.

Thank You

Ricky Jones

H&A Scientific Inc.
 
Hi Ricky,

I think you may try to use the CreateInstance method of Activator.
Here is my demo.
public static void Main()
{
ChannelServices.RegisterChannel(new TcpChannel());
HelloServiceClass service;
object[] url = {new UrlAttribute("tcp://localhost:8083/MyServer")};
try
{
//The line
will failed for the unavailable port.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null,u
rl);
}
catch(System.Reflection.TargetInvocationException e)
{
Console.WriteLine(e.ToString());
}
url[0] = new UrlAttribute("tcp://localhost:8082/MyServer");
//The line will succeed.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null,u
rl);
if(service == null)
{
Console.WriteLine("Could not locate server.");
return;
}

// Calls the remote method.
Console.WriteLine();
Console.WriteLine("Calling remote object");
Console.WriteLine(service.HelloMethod("Caveman"));
Console.WriteLine(service.HelloMethod("Spaceman"));
Console.WriteLine(service.HelloMethod("Client Man"));
Console.WriteLine("Finished remote object call");
Console.WriteLine();
}

Did this does the job for you?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Ricky Jones" <[email protected]>
References: <#[email protected]>
 
Hi Ricky,

Here is the code of server side and the ClassLibrary.
I divided the content into two posts to avoid the post being cut in stream.

[server]
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
namespace ConsoleApplication12
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class ServerClass
{

public static void Main()
{

ChannelServices.RegisterChannel(new TcpChannel(8082));
RemotingConfiguration.ApplicationName="MyServer";

RemotingConfiguration.RegisterActivatedServiceType(typeof(ClassLibrary6.Hell
oServiceClass));


Console.WriteLine("Press enter to stop this process.");
Console.ReadLine();
}
}

}

[ClassLibrary]
using System;

namespace ClassLibrary6
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class HelloServiceClass : MarshalByRefObject
{

static int n_instance;

public HelloServiceClass()
{
n_instance++;
Console.WriteLine(this.GetType().Name + " has been created. Instance #
= {0}", n_instance);
}


~HelloServiceClass()
{
Console.WriteLine("Destroyed instance {0} of HelloServiceClass.",
n_instance);
n_instance --;
}


public String HelloMethod(String name)
{

// Reports that the method was called.
Console.WriteLine();
Console.WriteLine("Called HelloMethod on instance {0} with the '{1}'
parameter.",
n_instance, name);

// Calculates and returns the result to the client.
return "Hi there " + name + ".";
}
}

}



Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Newsgroups: microsoft.public.dotnet.general
From: (e-mail address removed) (Peter Huang [MSFT])
Organization: Microsoft
Date: Fri, 12 Sep 2003 08:25:03 GMT
Subject: Re: unregister ActivatedClientType
X-Tomcat-NG: microsoft.public.dotnet.general
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi Ricky,

I think you may try to use the CreateInstance method of Activator.
Here is my demo.
public static void Main()
{
ChannelServices.RegisterChannel(new TcpChannel());
HelloServiceClass service;
object[] url = {new UrlAttribute("tcp://localhost:8083/MyServer")};
try
{
//The line
will failed for the unavailable port.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null, u
rl);
}
catch(System.Reflection.TargetInvocationException e)
{
Console.WriteLine(e.ToString());
}
url[0] = new UrlAttribute("tcp://localhost:8082/MyServer");
//The line will succeed.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null, u
rl);
if(service == null)
{
Console.WriteLine("Could not locate server.");
return;
}

// Calls the remote method.
Console.WriteLine();
Console.WriteLine("Calling remote object");
Console.WriteLine(service.HelloMethod("Caveman"));
Console.WriteLine(service.HelloMethod("Spaceman"));
Console.WriteLine(service.HelloMethod("Client Man"));
Console.WriteLine("Finished remote object call");
Console.WriteLine();
}

Did this does the job for you?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Ricky Jones" <[email protected]>
References: <#[email protected]>
Subject: Re: unregister ActivatedClientType
Date: Thu, 11 Sep 2003 09:10:44 -0400
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.56
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108144
X-Tomcat-NG: microsoft.public.dotnet.general

Thanks, for responding,

I accept a servername from the user, then I register an ActivatedClientType
to connect to the server. If you are unable to connect to the server it will
allow the user to reenter the servername. At this point though you cannot
reregister the type to point to the new server location. I've started
looking into using the activator class, but that seems to only work for
wellknowclienttypes not activatedclienttypes.

I looked at the article you sent me, it seems as though that is if the
object is already created.

Also note I'm setting up the remoting configuration through code.

Thank You

Ricky Jones

H&A Scientific Inc.
P
U
 
Thank you for your help
Looking at the Activator.CreateInstance in the MSDN library I was unable to
find any information on the call being used in that fashion
Is there anywhere else that I can find information on the
activationAttributes paramaters and what is allowed to be passed in.
Again thanks alot for your help.

Thanks,
Ricky Jones

Peter Huang said:
Hi Ricky,

I think you may try to use the CreateInstance method of Activator.
Here is my demo.
public static void Main()
{
ChannelServices.RegisterChannel(new TcpChannel());
HelloServiceClass service;
object[] url = {new UrlAttribute("tcp://localhost:8083/MyServer")};
try
{
//The line
will failed for the unavailable port.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null,u
rl);
}
catch(System.Reflection.TargetInvocationException e)
{
Console.WriteLine(e.ToString());
}
url[0] = new UrlAttribute("tcp://localhost:8082/MyServer");
//The line will succeed.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null,u
rl);
if(service == null)
{
Console.WriteLine("Could not locate server.");
return;
}

// Calls the remote method.
Console.WriteLine();
Console.WriteLine("Calling remote object");
Console.WriteLine(service.HelloMethod("Caveman"));
Console.WriteLine(service.HelloMethod("Spaceman"));
Console.WriteLine(service.HelloMethod("Client Man"));
Console.WriteLine("Finished remote object call");
Console.WriteLine();
}

Did this does the job for you?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Ricky Jones" <[email protected]>
References: <#[email protected]>
Subject: Re: unregister ActivatedClientType
Date: Thu, 11 Sep 2003 09:10:44 -0400
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.56
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108144
X-Tomcat-NG: microsoft.public.dotnet.general

Thanks, for responding,

I accept a servername from the user, then I register an ActivatedClientType
to connect to the server. If you are unable to connect to the server it will
allow the user to reenter the servername. At this point though you cannot
reregister the type to point to the new server location. I've started
looking into using the activator class, but that seems to only work for
wellknowclienttypes not activatedclienttypes.

I looked at the article you sent me, it seems as though that is if the
object is already created.

Also note I'm setting up the remoting configuration through code.

Thank You

Ricky Jones

H&A Scientific Inc.


http://groups.google.com/groups?hl=zh-CN&lr=&ie=UTF-8&oe=UTF-8&threadm=u6aP
e
69hCHA.1392%40tkmsftngp12&rnum=2&prev=/groups%3Fhl%3Dzh-CN%26lr%3D%26ie%3DU
T
 
Hi Ricky,

The MSDN said,
An instance of a type can be created at a local or remote site. If the type
is created remotely, an activation attribute parameter specifies the URI of
the remote site. The call to create the instance might pass through
intermediary sites before it reaches the remote site. Other activation
attributes can modify the environment, or context, in which the call
operates at the remote and intermediary sites.

For more information, please check the link below.
Activator Class
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemactivatorclasstopic.asp
Activator.CreateInstance Method (Type, Object[], Object[])
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemactivatorclasscreateinstancetopic6.asp


Here is a link about Client Activation, you may have a look.

Client Activation
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconclientactivation.asp

If you have any related question, please feel free to let me know.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Ricky Jones" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: unregister ActivatedClientType
Date: Fri, 12 Sep 2003 09:36:21 -0400
Lines: 162
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.44
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108275
X-Tomcat-NG: microsoft.public.dotnet.general

Thank you for your help
Looking at the Activator.CreateInstance in the MSDN library I was unable to
find any information on the call being used in that fashion
Is there anywhere else that I can find information on the
activationAttributes paramaters and what is allowed to be passed in.
Again thanks alot for your help.

Thanks,
Ricky Jones

Peter Huang said:
Hi Ricky,

I think you may try to use the CreateInstance method of Activator.
Here is my demo.
public static void Main()
{
ChannelServices.RegisterChannel(new TcpChannel());
HelloServiceClass service;
object[] url = {new UrlAttribute("tcp://localhost:8083/MyServer")};
try
{
//The line
will failed for the unavailable port.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null,
u
rl);
}
catch(System.Reflection.TargetInvocationException e)
{
Console.WriteLine(e.ToString());
}
url[0] = new UrlAttribute("tcp://localhost:8082/MyServer");
//The line will succeed.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null,
u
rl);
if(service == null)
{
Console.WriteLine("Could not locate server.");
return;
}

// Calls the remote method.
Console.WriteLine();
Console.WriteLine("Calling remote object");
Console.WriteLine(service.HelloMethod("Caveman"));
Console.WriteLine(service.HelloMethod("Spaceman"));
Console.WriteLine(service.HelloMethod("Client Man"));
Console.WriteLine("Finished remote object call");
Console.WriteLine();
}

Did this does the job for you?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------


http://groups.google.com/groups?hl=zh-CN&lr=&ie=UTF-8&oe=UTF-8&threadm=u6a P
e

69hCHA.1392%40tkmsftngp12&rnum=2&prev=/groups%3Fhl%3Dzh-CN%26lr%3D%26ie%3D U
T
 
Thank you for your help.


Peter Huang said:
Hi Ricky,

The MSDN said,
An instance of a type can be created at a local or remote site. If the type
is created remotely, an activation attribute parameter specifies the URI of
the remote site. The call to create the instance might pass through
intermediary sites before it reaches the remote site. Other activation
attributes can modify the environment, or context, in which the call
operates at the remote and intermediary sites.

For more information, please check the link below.
Activator Class
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemactivatorclasstopic.asp
Activator.CreateInstance Method (Type, Object[], Object[])
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemactivatorclasscreateinstancetopic6.asp


Here is a link about Client Activation, you may have a look.

Client Activation
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconclientactivation.asp

If you have any related question, please feel free to let me know.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Ricky Jones" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: unregister ActivatedClientType
Date: Fri, 12 Sep 2003 09:36:21 -0400
Lines: 162
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.44
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108275
X-Tomcat-NG: microsoft.public.dotnet.general

Thank you for your help
Looking at the Activator.CreateInstance in the MSDN library I was unable to
find any information on the call being used in that fashion
Is there anywhere else that I can find information on the
activationAttributes paramaters and what is allowed to be passed in.
Again thanks alot for your help.

Thanks,
Ricky Jones

Peter Huang said:
Hi Ricky,

I think you may try to use the CreateInstance method of Activator.
Here is my demo.
public static void Main()
{
ChannelServices.RegisterChannel(new TcpChannel());
HelloServiceClass service;
object[] url = {new UrlAttribute("tcp://localhost:8083/MyServer")};
try
{
//The line
will failed for the unavailable port.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null,
u
rl);
}
catch(System.Reflection.TargetInvocationException e)
{
Console.WriteLine(e.ToString());
}
url[0] = new UrlAttribute("tcp://localhost:8082/MyServer");
//The line will succeed.
service =
(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null,
u
rl);
if(service == null)
{
Console.WriteLine("Could not locate server.");
return;
}

// Calls the remote method.
Console.WriteLine();
Console.WriteLine("Calling remote object");
Console.WriteLine(service.HelloMethod("Caveman"));
Console.WriteLine(service.HelloMethod("Spaceman"));
Console.WriteLine(service.HelloMethod("Client Man"));
Console.WriteLine("Finished remote object call");
Console.WriteLine();
}

Did this does the job for you?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Ricky Jones" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: unregister ActivatedClientType
Date: Thu, 11 Sep 2003 09:10:44 -0400
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.56
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108144
X-Tomcat-NG: microsoft.public.dotnet.general

Thanks, for responding,

I accept a servername from the user, then I register an ActivatedClientType
to connect to the server. If you are unable to connect to the server it
will
allow the user to reenter the servername. At this point though you cannot
reregister the type to point to the new server location. I've started
looking into using the activator class, but that seems to only work for
wellknowclienttypes not activatedclienttypes.

I looked at the article you sent me, it seems as though that is if the
object is already created.

Also note I'm setting up the remoting configuration through code.

Thank You

Ricky Jones

H&A Scientific Inc.

Hi Ricky,

I do not think you can unregister an ActivatedClientTypeEntry after you
have registered it in the remoting config.
Can you tell me what you want to do?

Here is link, you may have a check and let me know if that is what you
want
to do.
69hCHA.1392%40tkmsftngp12&rnum=2&prev=/groups%3Fhl%3Dzh-CN%26lr%3D%26ie%3D
U
T
F-8%26oe%3DUTF-8%26q%3DActivatedClientTypeEntry%2Band%2Bunregister

I look forward to hearing from you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no
rights.
--------------------
From: "Ricky Jones" <[email protected]>
Subject: unregister ActivatedClientType
Date: Wed, 10 Sep 2003 11:06:47 -0400
Lines: 4
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.36
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107959
X-Tomcat-NG: microsoft.public.dotnet.general

Is there any way to unregister a ActivatedClientType?
thanks, Ricky Jones
 
Hi Ricky,

I am glad that I can help you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Ricky Jones" <[email protected]>
References: <#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Subject: Re: unregister ActivatedClientType
Date: Mon, 15 Sep 2003 09:23:39 -0400
Lines: 246
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.57
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:108221
X-Tomcat-NG: microsoft.public.dotnet.general

Thank you for your help.


Peter Huang said:
Hi Ricky,

The MSDN said,
An instance of a type can be created at a local or remote site. If the type
is created remotely, an activation attribute parameter specifies the URI of
the remote site. The call to create the instance might pass through
intermediary sites before it reaches the remote site. Other activation
attributes can modify the environment, or context, in which the call
operates at the remote and intermediary sites.

For more information, please check the link below.
Activator Class
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html
/
frlrfsystemactivatorclasstopic.asp
Activator.CreateInstance Method (Type, Object[], Object[])
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html
/
frlrfsystemactivatorclasscreateinstancetopic6.asp


Here is a link about Client Activation, you may have a look.

Client Activation
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht
m
l/cpconclientactivation.asp

If you have any related question, please feel free to let me know.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Ricky Jones" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: unregister ActivatedClientType
Date: Fri, 12 Sep 2003 09:36:21 -0400
Lines: 162
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.44
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108275
X-Tomcat-NG: microsoft.public.dotnet.general

Thank you for your help
Looking at the Activator.CreateInstance in the MSDN library I was unable to
find any information on the call being used in that fashion
Is there anywhere else that I can find information on the
activationAttributes paramaters and what is allowed to be passed in.
Again thanks alot for your help.

Thanks,
Ricky Jones

Hi Ricky,

I think you may try to use the CreateInstance method of Activator.
Here is my demo.
public static void Main()
{
ChannelServices.RegisterChannel(new TcpChannel());
HelloServiceClass service;
object[] url = {new UrlAttribute("tcp://localhost:8083/MyServer")};
try
{
//The line
will failed for the unavailable port.
service =

(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null ,
u
rl);
}
catch(System.Reflection.TargetInvocationException e)
{
Console.WriteLine(e.ToString());
}
url[0] = new UrlAttribute("tcp://localhost:8082/MyServer");
//The line will
succeed.
service =

(HelloServiceClass)Activator.CreateInstance(typeof(HelloServiceClass),null ,
u
rl);
if(service == null)
{
Console.WriteLine("Could not locate server.");
return;
}

// Calls the remote method.
Console.WriteLine();
Console.WriteLine("Calling remote object");
Console.WriteLine(service.HelloMethod("Caveman"));
Console.WriteLine(service.HelloMethod("Spaceman"));
Console.WriteLine(service.HelloMethod("Client Man"));
Console.WriteLine("Finished remote object call");
Console.WriteLine();
}

Did this does the job for you?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "Ricky Jones" <[email protected]>
References: <#[email protected]>
<[email protected]>
Subject: Re: unregister ActivatedClientType
Date: Thu, 11 Sep 2003 09:10:44 -0400
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.56
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108144
X-Tomcat-NG: microsoft.public.dotnet.general

Thanks, for responding,

I accept a servername from the user, then I register an
ActivatedClientType
to connect to the server. If you are unable to connect to the server it
will
allow the user to reenter the servername. At this point though you cannot
reregister the type to point to the new server location. I've started
looking into using the activator class, but that seems to only work for
wellknowclienttypes not activatedclienttypes.

I looked at the article you sent me, it seems as though that is if the
object is already created.

Also note I'm setting up the remoting configuration through code.

Thank You

Ricky Jones

H&A Scientific Inc.

Hi Ricky,

I do not think you can unregister an ActivatedClientTypeEntry after you
have registered it in the remoting config.
Can you tell me what you want to do?

Here is link, you may have a check and let me know if that is what you
want
to do.
a
P
69hCHA.1392%40tkmsftngp12&rnum=2&prev=/groups%3Fhl%3Dzh-CN%26lr%3D%26ie%3
D
U
T
F-8%26oe%3DUTF-8%26q%3DActivatedClientTypeEntry%2Band%2Bunregister

I look forward to hearing from you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no
rights.
--------------------
From: "Ricky Jones" <[email protected]>
Subject: unregister ActivatedClientType
Date: Wed, 10 Sep 2003 11:06:47 -0400
Lines: 4
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 207.14.226.36
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107959
X-Tomcat-NG: microsoft.public.dotnet.general

Is there any way to unregister a ActivatedClientType?
thanks, Ricky Jones
 

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

Back
Top