GetDefaultStandardEndpointElement() protected abstract method

protected abstract GetDefaultStandardEndpointElement ( ) : System.ServiceModel.Configuration.StandardEndpointElement
return System.ServiceModel.Configuration.StandardEndpointElement
コード例 #1
0
        public static ServiceEndpoint ConfigureStandardEndpoint(ContractDescription cd, ServiceEndpointElement element)
        {
            string kind = element.Kind;
            string endpointConfiguration = element.EndpointConfiguration;

            EndpointCollectionElement section = ConfigUtil.StandardEndpointsSection [kind];

            if (section == null)
            {
                throw new ArgumentException(String.Format("standard endpoint section for '{0}' was not found.", kind));
            }

            StandardEndpointElement e = section.GetDefaultStandardEndpointElement();

            ServiceEndpoint inst = e.CreateServiceEndpoint(cd);

            foreach (StandardEndpointElement el in section.ConfiguredEndpoints)
            {
                if (el.Name == endpointConfiguration)
                {
                    el.InitializeAndValidate(element);
                    el.ApplyConfiguration(inst, element);
                    break;
                }
            }

            return(inst);
        }