示例#1
0
        private static string StartServer(Type typeOfService)
        {
            string address = _base + typeOfService.Name;
            var    srv     = new CallbackService(new CallbackData {
                Data = "Hello from Server"
            });
            var server = new ServiceHost(srv, new Uri(address));

            server.AddServiceEndpoint(typeOfService, _binding, address);
            server.Open();
            ConsoleEx.SrvWriteLine("Server started :" + address);

            return(address);
        }
示例#2
0
        private static string StartServer(Type typeOfService)
        {
            string address = _base + typeOfService.Name;
            var srv = new CallbackService(new CallbackData {Data = "Hello from Server"});
            var server = new ServiceHost(srv, new Uri(address));
            server.AddServiceEndpoint(typeOfService, _binding, address);
            server.Open();
            ConsoleEx.SrvWriteLine("Server started :" + address);

            return address;
        }