WellKnownClientTypeEntry Class

Holds values for an object type registered on the client as a server-activated type (single call or singleton).

System::Object
  System.Runtime.Remoting::TypeEntry
    System.Runtime.Remoting::WellKnownClientTypeEntry

Namespace:  System.Runtime.Remoting
Assembly:  mscorlib (in mscorlib.dll)

[ComVisibleAttribute(true)]
public ref class WellKnownClientTypeEntry : public TypeEntry

The WellKnownClientTypeEntry type exposes the following members.

  NameDescription
Public methodWellKnownClientTypeEntry(Type, String)Initializes a new instance of the WellKnownClientTypeEntry class with the given type and URL.
Public methodWellKnownClientTypeEntry(String, String, String)Initializes a new instance of the WellKnownClientTypeEntry class with the given type, assembly name, and URL.
Top

  NameDescription
Public propertyApplicationUrlGets or sets the URL of the application to activate the type in.
Public propertyAssemblyNameGets the assembly name of the object type configured to be a remote-activated type. (Inherited from TypeEntry.)
Public propertyObjectTypeGets the Type of the server-activated client type.
Public propertyObjectUrlGets the URL of the server-activated client object.
Public propertyTypeNameGets the full type name of the object type configured to be a remote-activated type. (Inherited from TypeEntry.)
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns the full type name, assembly name, and object URL of the server-activated client type as a String. (Overrides Object::ToString().)
Top

Server-activated types can be either single call or singleton. If a class is registered as a single call type, a new instance is created each time a call from the client arrives. All calls to a singleton object are handled by one instance of that object, unless that object has been collected.

Any client that knows the URI of a registered server-activated object can obtain a proxy for this object by registering the channel it prefers with ChannelServices and activating the object by calling new or Activator::GetObject. To activate a server-activated object with new, you must first register the server-activated object type on the client using the RegisterWellKnownClientType method. By calling RegisterWellKnownClientType, you are giving the remoting infrastructure the location of the remote object, which allows the new keyword to create it. If, on the other hand, you use the Activator::GetObject method to activate a server-activated object, you must supply it with the object's URL as an argument, so no prior registration on the client is necessary.

For a detailed description of server-activated objects and remote object activation, see [<topic://cpconActivation>].

#using <System.Runtime.Remoting.dll>
#using <System.dll>
#using <WellKnownClientTypeEntry_Share.dll>

using namespace System;
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Channels;
using namespace System::Runtime::Remoting::Channels::Http;

int main()
{
   // Create a 'HttpChannel' object and  register with channel services.
   ChannelServices::RegisterChannel( gcnew HttpChannel );
   Console::WriteLine( " Start calling from Client One......." );
   WellKnownClientTypeEntry^ myWellKnownClientTypeEntry = gcnew WellKnownClientTypeEntry( HelloServer::typeid,"http://localhost:8086/SayHello" );
   myWellKnownClientTypeEntry->ApplicationUrl = "http://localhost:8086/SayHello";
   RemotingConfiguration::RegisterWellKnownClientType( myWellKnownClientTypeEntry );

   // Get the proxy object for the remote object.
   HelloServer^ myHelloServerObject = gcnew HelloServer;

   // Retrieve an array of object types registered on the  
   // client end as well-known types. 
   array<WellKnownClientTypeEntry^>^myWellKnownClientTypeEntryCollection = RemotingConfiguration::GetRegisteredWellKnownClientTypes();
   Console::WriteLine( "The Application Url to activate the Remote Object :{0}", myWellKnownClientTypeEntryCollection[ 0 ]->ApplicationUrl );
   Console::WriteLine( "The 'WellKnownClientTypeEntry' object :{0}", myWellKnownClientTypeEntryCollection[ 0 ] );

   // Make remote method calls. 
   for ( int i = 0; i < 5; i++ )
      Console::WriteLine( myHelloServerObject->HelloMethod( " Client One" ) );
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft