Exposing metadata using an HTTP endpoint
Instructions for exposing the metadata of a service which is configured to use the IBM® MQ custom channel for WCF.
About this task
- Add the base address of where the metadata must be exposed to the ServiceHost, for example:
ServiceHost service = new ServiceHost(typeof(TestService), new Uri("http://localhost:8000/MyService")); - Add the following code to the ServiceHost before the service is opened:
ServiceMetadataBehavior metadataBehavior = new ServiceMetadataBehavior(); metadataBehavior.HttpGetEnabled = true; service.Description.Behaviors.Add(metadataBehavior); service.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), "mex");