Host-Configuration
Client-Configuration
Host-Code
static void Main(string[] args) { log4net.ILog log = log4net.LogManager.GetLogger(EqualsConst.GetServiceLoggerName); Listhosts = new List () { new ServiceHost(typeof(UserBll)), new ServiceHost(typeof(ExamBll)) }; try { foreach (ServiceHost host in hosts) { host.Open(); } Console.WriteLine(EqualsConst.OpenService); Console.ReadLine(); foreach (ServiceHost host in hosts) { host.Close(); } } catch (Exception ex) { log.Error(ex.Message, ex); } }
Interface
[ServiceContract(Namespace="XXX")] public interface IUserBll { [OperationContract] User RetrieveUserByUserName(string userName);