You can enable the WS-Discovery feature in your project. More details here: https://msdn.microsoft.com/en-us/us-us/library/dd456791(v=vs.110).aspx
In short, this can be done programmatically like this:
Uri baseAddress = new Uri(string.Format("http://{0}:8000/discovery/scenarios/calculatorservice/{1}/", System.Net.Dns.GetHostName(), Guid.NewGuid().ToString())); // Create a ServiceHost for the CalculatorService type. using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress)) { // add calculator endpoint serviceHost.AddServiceEndpoint(typeof(ICalculator), new WSHttpBinding(), string.Empty); // ** DISCOVERY ** // // make the service discoverable by adding the discovery behavior ServiceDiscoveryBehavior discoveryBehavior = new ServiceDiscoveryBehavior(); serviceHost.Description.Behaviors.Add(new ServiceDiscoveryBehavior()); // send announcements on UDP multicast transport discoveryBehavior.AnnouncementEndpoints.Add( new UdpAnnouncementEndpoint()); // ** DISCOVERY ** // // add the discovery endpoint that specifies where to publish the services serviceHost.Description.Endpoints.Add(new UdpDiscoveryEndpoint()); // Open the ServiceHost to create listeners and start listening for messages. serviceHost.Open(); // The service can now be accessed. Console.WriteLine("Press <ENTER> to terminate service."); Console.ReadLine(); }
Then, by adding a link, you can open your services with this behavior.
eocron
source share