.net remoting config

  • Thread starter Thread starter Paul Fi
  • Start date Start date
P

Paul Fi

I have this sample configuration file for a remoting app:

<service>
<wellknown mode="SingleCall"
type="Microsoft.Samples.Runtime.Remoting.Security.Sample.Server.Foo,
Microsoft.Samples.Runtime.Remoting.Security.Sample.Server"
objectUri="Foo.rem" />
</service>

<channels>
<channel ref="http">
<serverProviders>
<provider type="Microsoft.Samples.Runtime.Remoting.Security.
SecurityServerChannelSinkProvider,
Microsoft.Samples.Runtime.Remoting.Security"
securityPackage="negotiate" />
<formatter ref="soap" />
</serverProviders>
</channel>
</channels>

But what i want is the equivalent of this done programatically
how can this be done exactly like the config file but programmticaly?

pls help
 
You have to build up a chain so I guess it would look something like this:

IDictionary props = new Hashtable();
props["name"] = "MyHttpChannel";

SoapServerFormatterSinkProvider soap = new
SoapServerFormatterSinkProvider();
Microsoft.Samples.Runtime.Remoting.Security.SecurityServerChannelSinkProvide
r security =
new
Microsoft.Samples.Runtime.Remoting.Security.SecurityServerChannelSinkProvide
r(/*may be some params here*/);

soap.NextSink = security;
HttpChannel channel = new HttpChannel(
props,
null,
soap);
ChannelServices.RegisterChannel(channel);

Hope this helps,

Colin
 
Back
Top