.NET Remote Client Object Sample Code: Server-activated Client

This sample is dependent on the successful implementation of a server-activated remote object. The sample consists of a simple console application that demonstrates how to execute a task via a server-activated remote object hosted in a custom application. Whenever a Web service or a remote object is generated, a configuration file is also created. Below is a sample of a custom host application using a server-activated remote object and a sample configuration file.

using System;
using System.Runtime.Remoting;

namespace CSharpClient
  /// <summary>
  /// A simple console application that demonstrates how to host a
  /// server-activated remote object.  This application listens for
  /// client requests on TCP port 8989.
  /// </summary>
  class Class1
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    static void Main(string[] args)
        //Configure RemoteTestFactory as a server-activated object

        //Wait for remote client requests
        Console.WriteLine("Listening for requests. Press Enter to exit...");

      catch (Exception xx)

Sample Configuration File: RemoteTestServer.config

<?xml version="1.0" encoding="UTF-8"?>
<!-- Configuration for a server-activated RemoteTestFactory singleton-->
<wellknown mode="Singleton" type="AMNUtask.RemoteTestFactory, AMNUtask" objectUri="AMNUtask"/>
<channel port="8989" ref="tcp">
<formatter ref="binary"/>
Related Topics
Bullet Using .NET
Bullet Adding .NET Remotable Objects to .NET Projects
Bullet .NET Deployment Examples