15.02.2015 Views

C# 4 and .NET 4

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Configuration files ❘ OC217<br />

server Configuration for Client-activated objects<br />

By changing only the configuration file (located in ClientActivated_Server.config), you can change the<br />

server configuration from server-activated to client-activated objects. Here the subelement of<br />

the element is specified. With the element for the server configuration, only the<br />

type attribute must be specified. The name attribute of the application element defines the URI:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Client Configuration for Client-activated objects<br />

code snippet ConfigurationFiles/HelloServer/ClientActivated.config<br />

The ClientActivated_Client.config file defines the client-activated remote object using the url<br />

attribute of the element <strong>and</strong> the type attribute of the element:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

server Code using Configuration files<br />

code snippet ConfigurationFiles/HelloClient/ClientActivated_Client.config<br />

In the server code, you have to configure remoting using the static method Configure() from the<br />

RemotingConfiguration class. Here all channels that are defined in the configuration file are created <strong>and</strong><br />

configured with the .<strong>NET</strong> Remoting runtime. Maybe you also want to know about the channel<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!