 | 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
| | 1: *
| | 2: * Written By : Arindam Chakraborty on 8th Oct 2007
| | 3: *
| | 4: * Modified By :
| | 5: * Reason :
| | 6: *
| | 7: */
| | 8:using System;
| | 9:using System.Collections.Generic;
| | 10:using System.Text;
| | 11:using System.Runtime.Remoting;
| | 12:using System.Runtime.Remoting.Channels;
| | 13:using System.Runtime.Remoting.Channels.Tcp;
| | 14:using System.Runtime.Remoting.Channels.Http;
| | 15:using System.Runtime.Serialization.Formatters.Soap;
| | 16:using System.ServiceModel;
| | 17:using System.Net;
| | 18:using COBankDTO;
| | 19:
| | 20:namespace ETigers.Remoting.RemoteServer
| | 21:{
| | 22: public class ServerHandeler
| | 23: {
| | 24:
| | 25: private ServiceHost _host = null;
| | 26:
| | 27:
| | 28: public ServerHandeler()
| | 29: {
| | 30:
| | 31: }
| | 32:
| | 33: public void StartServer()
| | 34: {
| | 35: try
| | 36: {
| | 37: System.Type _type = typeof(ETigers.Remoting.DTO.BusinessExceptionSummary);
| | 38: RemotingConfiguration.RegisterWellKnownServiceType(new WellKnownServiceTypeEntry(_type, "BusinessExceptionSummary.soap", WellKnownObjectMode.Singleton));
| | 39:
| | 40: string _serverConfigPath = System.Configuration.ConfigurationSettings.AppSettings["ServerConfigfile"];
| | 41: RemotingConfiguration.Configure(_serverConfigPath + "web.Config", false);
| | 42:
| | 43: //IBusinessException
| | 44: Console.WriteLine("Remote server started successfully");
| | 45: }
| | 46: catch (Exception ex)
| | 47: {
| | 48: Console.WriteLine("Error occured while starting server");
| | 49: }
| | 50: }
| | 51:
| | 52:
| | 53:
| | 54: }
| | 55:}
| | 56:
| | 57: |
|