 | 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");
| | }
| | }
| |
| |
| |
| | }
| | }
| |
| |
|