public IEnumerable <ConfigEnpointData> GetServiceEndpoints(ConfigServiceData service) { foreach (var contractInterface in service.ServiceType.GetInterfaces().Where(inf => ConfigExtensions.IsServiceContract(inf))) { yield return(new ConfigEnpointData(contractInterface.FullName, GetBindingName(), contractInterface.Name)); } if (_isGeneratingMetadataEndpoint) { yield return(new ConfigEnpointData("IMetadataExchange", "mexHttpBinding", "mex")); } }
public IEnumerable<ConfigEnpointData> GetServiceEndpoints(ConfigServiceData service) { foreach (var contractInterface in service.ServiceType.GetInterfaces().Where(inf => ConfigExtensions.IsServiceContract(inf))) { yield return new ConfigEnpointData(contractInterface.FullName, GetBindingName(), contractInterface.Name); } if (_isGeneratingMetadataEndpoint) { yield return new ConfigEnpointData("IMetadataExchange", "mexHttpBinding", "mex"); } }
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; }