WellKnownServiceTypeEntry Class

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

System.Object
  System.Runtime.Remoting.TypeEntry
    System.Runtime.Remoting.WellKnownServiceTypeEntry

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

[ComVisibleAttribute(true)]
public class WellKnownServiceTypeEntry : TypeEntry

The WellKnownServiceTypeEntry type exposes the following members.

  NameDescription
Public methodWellKnownServiceTypeEntry(Type, String, WellKnownObjectMode)Initializes a new instance of the WellKnownServiceTypeEntry class with the given Type, object URI, and WellKnownObjectMode.
Public methodWellKnownServiceTypeEntry(String, String, String, WellKnownObjectMode)Initializes a new instance of the WellKnownServiceTypeEntry class with the given type name, assembly name, object URI, and WellKnownObjectMode.
Top

  NameDescription
Public propertyAssemblyNameGets the assembly name of the object type configured to be a remote-activated type. (Inherited from TypeEntry.)
Public propertyContextAttributesGets or sets the context attributes for the server-activated service type.
Public propertyModeGets the WellKnownObjectMode of the server-activated service type.
Public propertyObjectTypeGets the Type of the server-activated service type.
Public propertyObjectUriGets the URI of the well-known service type.
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 type name, assembly name, object URI and the WellKnownObjectMode of the server-activated type as a String. (Overrides Object.ToString().)
Top

Server-activated object types can be either single call or singleton. If an object type is single call, a new instance of it is created each time a call from the client comes in. All calls to a singleton object are handled by one instance of that object.

Any client that knows the URI of this 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.

It is important to note that the remote object itself is not created by the registration process. This only happens when a client attempts to call a method on the object or activates the object from the client side.

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

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

public class MyServer 
{
   public static void Main() 
   {
      // Create a 'HttpChannel' object and register it with the  
      // channel services.
      ChannelServices.RegisterChannel(new HttpChannel(8086));
      // Record the 'HelloServer' type as 'Singleton' well-known type.
      WellKnownServiceTypeEntry myWellKnownServiceTypeEntry= 
          new WellKnownServiceTypeEntry(typeof(HelloServer),
                                        "SayHello",
                                        WellKnownObjectMode.Singleton);
      // Register the remote object as well-known type.
      RemotingConfiguration.RegisterWellKnownServiceType(
                                          myWellKnownServiceTypeEntry);
      // Retrieve object types registered on the service end  
      // as well-known types.
      WellKnownServiceTypeEntry [] myWellKnownServiceTypeEntryCollection = 
            RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
      Console.WriteLine("The 'WellKnownObjectMode' of the remote object : "
                       +myWellKnownServiceTypeEntryCollection[0].Mode);
      Console.WriteLine("The 'WellKnownServiceTypeEntry' object: "+
                  myWellKnownServiceTypeEntryCollection[0].ToString());
      Console.WriteLine("Started the Server, Hit <enter> to exit...");
      Console.ReadLine();
   }
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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:
© 2015 Microsoft