Created
May 5, 2012 18:16
-
-
Save yaronn/2604494 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
using (ServiceHost host = new ServiceHost(typeof(Service))) | |
{ | |
host.Description.Behaviors.Add(new ServiceMetadataBehavior() { | |
HttpGetEnabled = true, | |
HttpGetUrl = new System.Uri("http://localhost:7171/")}); | |
var ep = host.AddServiceEndpoint("IService", new BasicHttpBinding(), | |
"http://localhost:7171/"); | |
ep.Behaviors.Add(new MyWsdlExporter()); | |
host.Open(); | |
Console.WriteLine("\nPress enter to close service...\n"); | |
Console.ReadLine(); | |
} | |
} | |
class MyWsdlExporter : IWsdlExportExtension, IEndpointBehavior | |
{ | |
public void ExportEndpoint(WsdlExporter exporter, | |
WsdlEndpointConversionContext context) | |
{ | |
context.WsdlPort.Documentation = "crearted on " + DateTime.Now.ToString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment