public HttpConfigurationStrategy(IEnumerable <Type> serviceTypes, bool isGeneratingMetadataEndpoint = false) { foreach (var serviceType in serviceTypes) { var serviceData = new ConfigServiceData(serviceType); serviceData.Endpoints = GetServiceEndpoints(serviceData); if (isGeneratingMetadataEndpoint) { string behaviorName = serviceType.Name + "Behavior"; serviceData.BehaviorName = behaviorName; ConfigServiceBehaviorData behavior = new ConfigServiceBehaviorData() { Name = behaviorName, Content = new XElement("behavior", new XAttribute("name", behaviorName), new XElement("serviceMetadata", new XAttribute("httpGetEnabled", true)), new XElement("serviceDebug", new XAttribute("includeExceptionDetailInFaults", true))) }; _serviceBehaviors.Add(behavior); } _services.Add(serviceData); } _isGeneratingMetadataEndpoint = isGeneratingMetadataEndpoint; }
public HttpConfigurationStrategy(IEnumerable<Type> serviceTypes, bool isGeneratingMetadataEndpoint = false) { foreach (var serviceType in serviceTypes) { var serviceData = new ConfigServiceData(serviceType); serviceData.Endpoints = GetServiceEndpoints(serviceData); if (isGeneratingMetadataEndpoint) { string behaviorName = serviceType.Name + "Behavior"; serviceData.BehaviorName = behaviorName; ConfigServiceBehaviorData behavior = new ConfigServiceBehaviorData() { Name = behaviorName, Content = new XElement("behavior", new XAttribute("name", behaviorName), new XElement("serviceMetadata", new XAttribute("httpGetEnabled", true)), new XElement("serviceDebug", new XAttribute("includeExceptionDetailInFaults", true))) }; _serviceBehaviors.Add(behavior); } _services.Add(serviceData); } _isGeneratingMetadataEndpoint = isGeneratingMetadataEndpoint; }