The System.ServiceModel.Description.ServiceMetadataBehavior provides support for adding metadata endpoint to a service. These metadata endpoints can respond to HTTP GET requests at a URL that has a ?wsdl querystring and to WS-Transfer GET requests as defined in the WS-MetadataExchange (MEX) specification. MEX endpoints implement the System.ServiceModel.Description.IMetadataExchange contract.
Publishing Metadata Over a Custom Binding
Retrieving Metadata Over a Custom Binding
Metadata can be retrieved from HTTP Get and HTTPS Get metadata endpoints using standard HTTP or HTTPS GET requests.
To retrieve metadata from a MEX metadata endpoint you can generally use one of the standard MEX bindings supported by WCF. For more information, see System.ServiceModel.Description.MetadataExchangeBindings. The System.ServiceModel.Description.MetadataExchangeClient type and the Svcutil.exe tool automatically select one of these standard MEX bindings based on the address of the specified metadata endpoint.
If a MEX metadata endpoint uses a different binding than one of the standard MEX bindings, you can configure the binding used by the MetadataExchangeClient using code or by providing an IMetadataExchange client endpoint configuration. The Svcutil.exe tool automatically loads from its configuration file an IMetadataExchange client endpoint configuration that has the same name as the URI scheme for the metadata endpoint address.
Security
When publishing metadata over a custom binding, ensure that the binding provides the security support that your metadata requires. For example, to prevent information disclosure and ensure your client has the right to obtain the metadata, you can make your metadata and your application more secure by configuring your IMetadataExchange endpoint to require authentication and encryption. The sample Custom Secure Metadata Endpoint demonstrates this scenario.
See Also