DHTMLAsp.NetSQLC-SharpXMLFrameworkIISXMLWebServiceArchitecture
UMLProject ManagementSDLCMethodologiesDesign PatterenOOPWCF.Net RemotingWWF
MVPMVCSite Map
Asp.net 2.0
User Control
Custom Control
File Handling
Deligate
Site Map
Tell a Friend
You
Friend
Email

Newsletter
Email

 

 

What is Remoting in .Net ?

I was hearing the word for long time but never could understand completely, was bit afraid too. Only thing that i understood about remoting is that "Remoting is Distributed Architecture in .net", after giving a few try finally i am able to implement remoting successfully.

If a person like me can understand remoting, I can tell that each one of you can become a master of remoting. its really Fun.

So, before i start with a realltime implementation, i would like you to familer with few remoting key concepts.
Three major thing of remoting application are :

1. Remote Object Design and Chanel Registration.
2. Host Server.
3. Atleaset one Client.      

any developer can develope any of the above component easily, only the tricks remain in implementation. how to implement !!   

Now let's look at the code sample.

Server: The following code will demonstarte how to start server, all seetings are done in web.config , in code we just need call the configuration settings

Rmoting server code sample
/* Usage : This remote server is designed to process the database interaction through service host, and let all the clients to consume the service
*
* Written By : Arindam Chakraborty on 8th Oct 2007
*
* Modified By :
* Reason :
*
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Remoting.Channels.Http;
using System.Runtime.Serialization.Formatters.Soap;
using System.ServiceModel;
using System.Net;
using COBankDTO;
namespace ETigers.Remoting.RemoteServer
{
public class ServerHandeler
{
private ServiceHost _host = null;
public ServerHandeler()
{
}
public void StartServer()
{
try
{
System.Type _type = typeof(ETigers.Remoting.DTO.BusinessExceptionSummary);
RemotingConfiguration.RegisterWellKnownServiceType(new WellKnownServiceTypeEntry(_type, "BusinessExceptionSummary.soap", WellKnownObjectMode.Singleton));
string _serverConfigPath = System.Configuration.ConfigurationSettings.AppSettings["ServerConfigfile"];
RemotingConfiguration.Configure(_serverConfigPath + "web.Config", false);
//IBusinessException
Console.WriteLine("Remote server started successfully");
}
catch (Exception ex)
{
Console.WriteLine("Error occured while starting server");
}
}
}
}

The following steps demonstrate how to design a configuration file, this step really very important, it also gives a very clear picture about the details of remoting framework under .net
Rmoting configuartion sample
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="http" name="COBRemote">
<serverProviders>
<provider ref="wsdl" />
<formatter ref="soap" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
<service>
<wellknown type="COBankDTO.BusinessExceptionHandling.BusinessExceptionSummary, COBankDTO" mode="Singleton" objectUri="BusinessExceptionSummary.soap"/>
</service>
</application>
</system.runtime.remoting>
<connectionStrings>
<add name="ConnectionString" connectionString="server=14.156.37.21;Initial Catalog=Databasename;User Id=userid;Password=password" providerName="System.Data.OracleClient" />
</connectionStrings>
</configuration>
Privacy Policy ©2007 E-Tigers.net, All Rights Reserved Terms & Conditions
Supported by ETG Consultancy