public void TestAddOrReplaceServiceBehavior() { var host = new System.ServiceModel.ServiceHost(typeof(GeneralTestService)); host.AddServiceEndpoint(typeof(IGeneralTestService), new BasicHttpBinding(), new Uri("http://localhost:7777/services/extensions")); var mdb = new ServiceMetadataBehavior(); mdb.HttpGetEnabled = true; host.AddOrReplaceBehavior<ServiceMetadataBehavior>(mdb); }