Tuesday, April 13, 2010

WCF : MES Endpoint

The Metadata Exchange Endpoint is a special endpoint in WCF that exposes metadata used to describe a service.

ServiceMetadataBehavior ServiceBehavior = new ServiceMetadataBehavior();
behavior.HttpGetEnabled = true;
host.Description.Behaviors.Add(ServiceBehavior);

host.AddServiceEndpoint(
typeof(IMetadataExchange),
MetadataExchangeBindings.CreateMexHttpBinding(),
"http://localhost/MyService/mex/");

where ServiceMetadataBehavior, IMetadataExchang and MetadataExchangeBindings available in the System.ServiceModel.Description namespace

No comments: