Enumerate Endpoints

 Download
Sample Gallery > Visual Studio Code Snippets
Sample Author


Company


Date Submitted
01/18/2006


Date Updated
01/18/2006



Total Downloads
623



Windows Communication Foundation Version:
vNovember/January



Licensing
Details


More Information
N/A

   
Sample Description
Just drop this file in a snippets folder of your choice and register the location with Visual Studio | Tools | Code Snippets Manager (VC#).

The sample snippet inserts debugging code to enumerate the service endpoints collection on an open service.

After a ServiceHost.Open(), just type wcfepr + Tab + Tab. This will expand into the following code:

foreach (EndpointListener listener in
serviceHost.EndpointListeners)
{
Console.WriteLine("Listening on " +
listener.GetEndpointAddress() + "...");
}
Screen Shot