WebReference.com - Part 1 of Chapter 6: Professional C# Web Services, from Wrox Press Ltd (8/8)
[previous] |
Professional C# Web Services
System.Runtime.Remoting Namespace
If we use configuration files, only one remoting call is necessary to read the
configuration file and start the channel. The only class we used from the
System.Runtime.Remoting namespace was Remoting Configuration. Instead of
using configuration files the channel startup can be done programmatically. Before we do this let's
get an overview of the classes that can be found in the remoting namespaces.
The System.Runtime.Remoting namespaces are contained in the assemblies
mscorlib and System.Runtime.Remoting:
In the namespace
System.Runtime.Remotingsome utility classes such asRemotingConfigurationandRemotingServicescan be found.RemotingConfigurationis used to read configuration files and to get information about the registered channels;RemotingServicesis used to publish remote objects.System.Runtime.Remoting.Activation: The channel uses the classRemotingDispatcherto dispatch method calls to the remote object. In this namespace, we can also find some interfaces for the activation of remote objects:IActivator,IConstructionCallMessage, andIConstructionReturnMessage.The namespace
System.Runtime.Remoting.Channelshas base classes for channels, and channel registration. An important class in this namespace isChannelServices. This utility class can be used to register and to unregister a channel with the methodsRegisterChannel()andUnRegisterChannel(), and it is also used to dispatch messages into a channel usingSyncDispatchMessage()orAsyncDispatchMessage().With the .NETF we get two channel types: TCP and HTTP. The TCP channels can be found in the namespace
System.Runtime.Remoting.Channels.Tcp, where as the HTTP channels are inSystem.Runtime.Remoting.Channels.Http. In the next chapter we will look into the differences between these channels.The
System.Runtime.Remoting.Contextsnamespace not only has classes for the context management inside an application domain, but also definesIContribute<XX>interfaces to intercept remoting calls.The lifetime of remote stateful objects is defined by a leasing mechanism. The namespace
System.Runtime.Remoting.Lifetimedefines the classesLifetimeServicesandClientSponsor, and the interfacesISponsorandILease.The namespace
System.Runtime.Remoting.Messagingdefines some interfaces for messages, such asIMessage,IMethodCallMessage, andIMethodReturnMessage. Method calls are converted to messages that are passed between message sinks. Message sinks are interceptors that can change messages before they are passed into the channel.The
soapsudstool converts assembly metadata to WSDL. The classes that help with these actions can be found in the namespacesSystem.Runtime.Remoting.MetadataandSystem.Runtime.Remoting.MetadataServices. We will use thesoapsudstool in Chapter 9.The namespace
System.Runtime.Remoting.Proxiescontains classes that control and provide proxies.
The classes in the System.Runtime.Remoting.Services namespace provide services to
the remoting framework. The class EnterpriseServicesHelper provides remoting functionality for
COM+ services, RemotingService can be used to access ASP.NET properties like
Application, Session, and User for web services running in Internet
Information Services. RemotingClientProxy is a base class for a proxy that is generated from
the soapsuds utility, and TrackingServices provides a way to register tracking
handlers.
Let's look in more detail at how to use the .NET Remoting architecture. [Continued in part 2. -Ed.]
[previous] |
Created: February 13, 2002
Revised: February 13, 2002
URL: http://webreference.com/programming/csharp/webservices/chap6/1/8.html

Find a programming school near you