• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Configuration.ServiceEndpointElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.ServiceModel.Configuration.ServiceEndpointElement的典型用法代码示例。如果您正苦于以下问题:C# ServiceEndpointElement类的具体用法?C# ServiceEndpointElement怎么用?C# ServiceEndpointElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ServiceEndpointElement类属于System.ServiceModel.Configuration命名空间,在下文中一共展示了ServiceEndpointElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnInitializeAndValidate

 protected override void OnInitializeAndValidate(ServiceEndpointElement serviceEndpointElement)
 {
     if (serviceEndpointElement.Address == null)
     {
         serviceEndpointElement.Address = this.Address;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:WorkflowControlEndpointElement.cs


示例2: InitializeAndValidate

 public void InitializeAndValidate(ServiceEndpointElement serviceEndpointElement)
 {
     if (serviceEndpointElement == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("serviceEndpointElement");
     }
     this.OnInitializeAndValidate(serviceEndpointElement);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:StandardEndpointElement.cs


示例3: OnInitializeAndValidate

 protected override void OnInitializeAndValidate(ServiceEndpointElement serviceEndpointElement)
 {
     if (String.IsNullOrEmpty(serviceEndpointElement.Binding))
     {
         serviceEndpointElement.Binding = ConfigurationStrings.MexHttpBindingCollectionElementName;
     }
     serviceEndpointElement.Contract = ServiceMetadataBehavior.MexContractName;
     serviceEndpointElement.IsSystemEndpoint = true;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:ServiceMetadataEndpointElement.cs


示例4: OnInitializeAndValidate

 protected override void OnInitializeAndValidate(ServiceEndpointElement serviceEndpointElement)
 {
     if (string.IsNullOrEmpty(serviceEndpointElement.Binding))
     {
         serviceEndpointElement.Binding = "mexHttpBinding";
     }
     serviceEndpointElement.Contract = "IMetadataExchange";
     serviceEndpointElement.IsSystemEndpoint = true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:ServiceMetadataEndpointElement.cs


示例5: InitializeAndValidate

        public void InitializeAndValidate(ServiceEndpointElement serviceEndpointElement)
        {
            if (null == serviceEndpointElement)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("serviceEndpointElement");
            }

            // The properties serviceEndpointElement.Name and this.Name are actually two different things:
            //     - serviceEndpointElement.Name corresponds to the service endpoint name 
            //     - this.Name is a token used as a key in the endpoint collection to identify
            //       a specific bucket of configuration settings.
            // Thus, the Name property is skipped here.

            this.OnInitializeAndValidate(serviceEndpointElement);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:15,代码来源:StandardEndpointElement.cs


示例6: ApplyConfiguration

 public void ApplyConfiguration(ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
 {
     if (endpoint == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpoint");
     }
     if (serviceEndpointElement == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("serviceEndpointElement");
     }
     if (endpoint.GetType() != this.EndpointType)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(System.ServiceModel.SR.GetString("ConfigInvalidTypeForEndpoint", new object[] { (this.EndpointType == null) ? string.Empty : this.EndpointType.AssemblyQualifiedName, endpoint.GetType().AssemblyQualifiedName }));
     }
     this.OnApplyConfiguration(endpoint, serviceEndpointElement);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:StandardEndpointElement.cs


示例7: CreateServiceEndpoint

        static ServiceEndpoint CreateServiceEndpoint(Type serviceType, ServiceEndpointElement endpointElement)
        {
            //创建ServiceEndpoint
            EndpointAddress address = new EndpointAddress(endpointElement.Address);
            Binding binding = ConfigLoader.CreateBinding(endpointElement.Binding);
            ContractDescription contract = CreateContractDescription(serviceType, endpointElement.Contract);
            ServiceEndpoint endpoint = new ServiceEndpoint(contract, binding, address);

            //添加终结点行为
            if (!string.IsNullOrEmpty(endpointElement.BehaviorConfiguration))
            {
                EndpointBehaviorElement behaviorElement = ConfigLoader.GetEndpointBehaviorElement(endpointElement.BehaviorConfiguration);
                foreach (BehaviorExtensionElement extensionElement in behaviorElement)
                {
                    IEndpointBehavior endpointBehavior = (IEndpointBehavior)extensionElement.CreateBehavior();
                    endpoint.Behaviors.Add(endpointBehavior);
                }
            }
            return endpoint;
        }
开发者ID:huoxudong125,项目名称:WCF-Demo,代码行数:20,代码来源:Program.cs


示例8: GenerateServiceEndpoint

        public ServiceEndpoint GenerateServiceEndpoint(ServiceHostBase serviceHost, Uri baseAddress)
        {
            Fx.Assert(serviceHost != null, "The 'serviceHost' parameter should not be null.");
            Fx.Assert(baseAddress != null, "The 'baseAddress' parameter should not be null.");

            AuthenticationSchemes supportedSchemes = GetAuthenticationSchemes(baseAddress);
            Type contractType = this.GetSingleImplementedContract();
            ConfigLoader configLoader = new ConfigLoader(serviceHost.GetContractResolver(this.implementedContracts));
            ServiceEndpointElement serviceEndpointElement = new ServiceEndpointElement();
            
            serviceEndpointElement.Contract = contractType.FullName;
            this.SetBindingConfiguration(baseAddress.Scheme, serviceEndpointElement);
            serviceEndpointElement.Kind = this.standardEndpointKind;

            ServiceEndpoint serviceEndpoint = configLoader.LookupEndpoint(serviceEndpointElement, null, serviceHost, serviceHost.Description, true);
            this.ConfigureBinding(serviceEndpoint.Binding, baseAddress.Scheme, supportedSchemes, AspNetEnvironment.Enabled);

            // Setting the Endpoint address and listenUri now that we've set the binding security
            ConfigLoader.ConfigureEndpointAddress(serviceEndpointElement, serviceHost, serviceEndpoint);
            ConfigLoader.ConfigureEndpointListenUri(serviceEndpointElement, serviceHost, serviceEndpoint);

            return serviceEndpoint;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:23,代码来源:AutomaticEndpointGenerator.cs


示例9: OnApplyConfiguration

 protected override void OnApplyConfiguration(ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
 {
     base.OnApplyConfiguration(endpoint, serviceEndpointElement);
     ApplyConfiguration(endpoint);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:5,代码来源:UdpAnnouncementEndpointElement.cs


示例10: ContractInfo

        public ContractInfo(Guid iid,
                            ServiceEndpointElement endpoint,
                            ComCatalogObject interfaceObject,
                            ComCatalogObject application)
        {
            this.name = endpoint.Contract;
            this.iid = iid;

            // Interface Roles
            //
            ComCatalogCollection roles;
            roles = interfaceObject.GetCollection("RolesForInterface");
            this.interfaceRoleMembers = CatalogUtil.GetRoleMembers(application,
                                                                   roles);

            // Operations
            //
            this.operations = new List<OperationInfo>();

            ComCatalogCollection methods;
            methods = interfaceObject.GetCollection("MethodsForInterface");
            foreach (ComCatalogObject method in methods)
            {
                this.operations.Add(new OperationInfo(method,
                                                      application));
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:27,代码来源:ServiceInfo.cs


示例11: OnInitializeAndValidate

        protected override void OnInitializeAndValidate(ServiceEndpointElement serviceEndpointElement)
        {
            base.OnInitializeAndValidate(serviceEndpointElement);

            ConfigurationUtility.InitializeAndValidateUdpServiceEndpointElement(serviceEndpointElement);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:6,代码来源:UdpAnnouncementEndpointElement.cs


示例12: ConfigureStandardEndpoint

		public static System.ServiceModel.Description.ServiceEndpoint ConfigureStandardEndpoint (System.ServiceModel.Description.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 ();

			System.ServiceModel.Description.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;
		}
开发者ID:nickchal,项目名称:pash,代码行数:23,代码来源:ConfigUtil.cs


示例13: OnApplyConfiguration

 protected override void OnApplyConfiguration(ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
 {
     //no additional configuration is required for MEX.
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:4,代码来源:ServiceMetadataEndpointElement.cs


示例14: OnInitializeAndValidate

 protected abstract void OnInitializeAndValidate(ServiceEndpointElement serviceEndpointElement);
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:1,代码来源:StandardEndpointElement.cs


示例15: OnApplyConfiguration

 protected override void OnApplyConfiguration(System.ServiceModel.Description.ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
 {
 }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:3,代码来源:System.ServiceModel.Configuration.ServiceMetadataEndpointElement.cs


示例16: OnInitializeAndValidate

 protected override void OnInitializeAndValidate(ServiceEndpointElement serviceEndpointElement)
 {            
     throw FxTrace.Exception.AsError(
         new InvalidOperationException(
             SR.DiscoveryConfigDynamicEndpointInService(serviceEndpointElement.Kind)));
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:6,代码来源:DynamicEndpointElement.cs


示例17: InitializeAndValidate

 public void InitializeAndValidate(ServiceEndpointElement serviceEndpointElement)
 {
 }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:3,代码来源:System.ServiceModel.Configuration.StandardEndpointElement.cs


示例18: BaseAddEndpointConfig

        // returns true if added successfully, or false if didnt add due to duplicate.
        protected bool BaseAddEndpointConfig(Configuration config, EndpointConfig endpointConfig)
        {
            ServiceModelSectionGroup sg = ServiceModelSectionGroup.GetSectionGroup(config);
            ServiceElementCollection serviceColl = sg.Services.Services;


            ServiceElement serviceElement = null;

            // Find serviceElement
            foreach (ServiceElement el in serviceColl)
            {
                if (endpointConfig.MatchServiceType(el.Name))
                {
                    serviceElement = el;
                    break;
                }
            }

            if (serviceElement == null)
            {
                // Didn't find one, create new element for this clsid
                serviceElement = new ServiceElement(endpointConfig.ServiceType);
                string baseServiceAddress = BaseServiceAddress(endpointConfig.Appid, endpointConfig.Clsid, endpointConfig.Iid);
                if (!String.IsNullOrEmpty(baseServiceAddress))
                {
                    BaseAddressElement bae = new BaseAddressElement();
                    bae.BaseAddress = baseServiceAddress;
                    serviceElement.Host.BaseAddresses.Add(bae);
                }
                sg.Services.Services.Add(serviceElement);
            }

            if (endpointConfig.IsMexEndpoint)
            {
                EnsureComMetaDataExchangeBehaviorAdded(config);
                serviceElement.BehaviorConfiguration = comServiceBehavior;
            }
            bool methodsAdded = false;
            if (!endpointConfig.IsMexEndpoint)
            {
                methodsAdded = AddComContractToConfig(config, endpointConfig.InterfaceName, endpointConfig.Iid.ToString("B"), endpointConfig.Methods);

            }

            // Now, check if endpoint already exists..
            foreach (ServiceEndpointElement ee in serviceElement.Endpoints)
            {
                bool listenerExists = true;
                if (this is ComplusEndpointConfigContainer)
                    listenerExists = ((ComplusEndpointConfigContainer)this).ListenerComponentExists;

                if (endpointConfig.MatchContract(ee.Contract))
                {
                    if (listenerExists)
                        return methodsAdded; // didn't add due to duplicate
                    else
                        serviceElement.Endpoints.Remove(ee);
                }
            }

            // All right, add the new endpoint now
            ServiceEndpointElement endpointElement = new ServiceEndpointElement(endpointConfig.Address, endpointConfig.ContractType);
            endpointElement.Binding = endpointConfig.BindingType;
            endpointElement.BindingConfiguration = endpointConfig.BindingName;
            serviceElement.Endpoints.Add(endpointElement);

            AddBinding(config);

            return true;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:71,代码来源:EndpointConfigContainer.cs


示例19: OnApplyConfiguration

		protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
		{
			throw new NotImplementedException ();
		}
开发者ID:nickchal,项目名称:pash,代码行数:4,代码来源:ServiceMetadataEndpointElement.cs


示例20: OnApplyConfiguration

		protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
		{
			if (endpoint == null)
				throw new ArgumentNullException ("endpoint");
			AnnouncementEndpoint ae = (AnnouncementEndpoint) endpoint;
			if (!ae.DiscoveryVersion.Equals (DiscoveryVersion))
				throw new ArgumentException ("Argument AnnouncementEndpoint is initialized with different DiscoveryVersion");
			ae.MaxAnnouncementDelay = MaxAnnouncementDelay;
			ae.Address = serviceEndpointElement.CreateEndpointAddress (); // it depends on InternalVisibleTo(System.ServiceModel)
			ae.Binding = ConfigUtil.CreateBinding (serviceEndpointElement.Binding, serviceEndpointElement.BindingConfiguration); // it depends on InternalVisibleTo(System.ServiceModel)
		}
开发者ID:jdecuyper,项目名称:mono,代码行数:11,代码来源:AnnouncementEndpointElement.cs



注:本文中的System.ServiceModel.Configuration.ServiceEndpointElement类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Configuration.ServiceModelExtensionElement类代码示例发布时间:2022-05-26
下一篇:
C# Configuration.ChannelEndpointElement类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap