static void Main(string[] args) { ServiceFinder <IGatewayService> finder = new ServiceFinder <IGatewayService>(); finder.ServiceDiscovied += GateWayServiceProxy.Default.ServiceDiscoveryHandle; finder.Start(); var binding = new CustomBinding(); binding.Elements.Add(new TextMessageEncodingBindingElement(MessageVersion.Soap12, Encoding.UTF8)); binding.Elements.Add(new HttpTransportBindingElement()); var stateServerWebService = ChannelFactory <IStateServerWebService> .CreateChannel(binding, new EndpointAddress("http://localhost:7778/Gateway/webService")); stateServerWebService.NotifyManagerStarted("nettcp// mangaer", "my iExchange"); using (ServiceHost host = new ServiceHost(typeof(CommandCollectService))) { host.Description.Behaviors.Add(new ServiceDiscoveryBehavior()); host.AddServiceEndpoint(new UdpDiscoveryEndpoint()); host.Open(); //Thread.Sleep(1000 * 60); //GateWayServiceProxy.Default.Place(CreateTransactionData()); Console.WriteLine("started "); Console.Read(); } }
static void Main(string[] args) { ServiceFinder <ICommandCollectService> finder = new ServiceFinder <ICommandCollectService>(); finder.ServiceDiscovied += address => { Broadcaster.Default.AddServices(address); }; finder.Start(); ServiceFinder <ITransactionServerService> transactionServerFinder = new ServiceFinder <ITransactionServerService>(); transactionServerFinder.ServiceDiscovied += TransactoinServerProxy.Default.ServiceDiscoveryHandle; transactionServerFinder.Start(); Hoster.Default.Start(); Console.WriteLine("Started"); Console.ReadLine(); }