Server-activated Remote Object Server Sample
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-actived remote object and a sample configuration file.
using System;
using System.Runtime.Remoting;
namespace CSharpClient
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
try
{
RemotingConfiguration.Configure("RemoteTestServer.config");
Console.WriteLine("Listening for requests. Press Enter to exit...");
Console.ReadLine();
}
catch (Exception xx)
{
Console.WriteLine(xx);
}
}
}
}
Sample Configuration File for Server-activated RemoteTestServer.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="Singleton" type="Test.RemoteTestFactory, Test" objectUri="Test"/>
</service>
<channels>
<channel port="8989" ref="tcp">
<serverProviders>
<formatter ref="binary"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>