当前位置: 首页>>代码示例>>C#>>正文


C# Channels.BindingParameterCollection类代码示例

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


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

示例1: AddBindingParameters

 /**
  * The execution of this behavior comes rather late.
  * Anyone that inspects the service description in the meantime,
  * such as for metadata generation, won't see the protection level that we want to use.
  *
  * One way of doing it is at when create HostFactory
  *
  * ServiceEndpoint endpoint = host.Description.Endpoints.Find(typeof(IService));
  * OperationDescription operation = endpoint.Contract.Operations.Find("Action");
  * MessageDescription message = operation.Messages.Find("http://tempuri.org/IService/ActionResponse");
  * MessageHeaderDescription header = message.Headers[new XmlQualifiedName("aheader", "http://tempuri.org/")];
  * header.ProtectionLevel = ProtectionLevel.Sign;
  *
  * **/
 public void AddBindingParameters(ContractDescription contractDescription, ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
 {
     ChannelProtectionRequirements requirements = bindingParameters.Find<ChannelProtectionRequirements>();
     XmlQualifiedName qName = new XmlQualifiedName(header, ns);
     MessagePartSpecification part = new MessagePartSpecification(qName);
     requirements.OutgoingSignatureParts.AddParts(part, action);
 }
开发者ID:cleancodenz,项目名称:ServiceBus,代码行数:21,代码来源:SignMessageHeaderBehavior.cs

示例2: AddBindingParameters

        public void AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters)
        {
            if (_innerOperationBehavior == null)
                return;

            (_innerOperationBehavior as IOperationBehavior).AddBindingParameters(operationDescription, bindingParameters);
        }
开发者ID:anbro,项目名称:hst,代码行数:7,代码来源:EfDataContractSerializerAttribute.cs

示例3: AddBindingParameters

        public void AddBindingParameters(OperationDescription description, BindingParameterCollection parameters)
        {
            //see if ChunkingBindingParameter already exists
            ChunkingBindingParameter param =
                parameters.Find<ChunkingBindingParameter>();
            if (param == null)
            {
                param = new ChunkingBindingParameter();
                parameters.Add(param);
            }

            if ((appliesTo & ChunkingAppliesTo.InMessage)
                          == ChunkingAppliesTo.InMessage)
            {
                //add input message's action to ChunkingBindingParameter
                param.AddAction(description.Messages[0].Action);
            }
            if (!description.IsOneWay &&
                ((appliesTo & ChunkingAppliesTo.OutMessage)
                            == ChunkingAppliesTo.OutMessage))
            {
                //add output message's action to ChunkingBindingParameter
                param.AddAction(description.Messages[1].Action);
            }
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:25,代码来源:ChunkingBehavior.cs

示例4: AddBindingParameters

		public void AddBindingParameters(
			ServiceDescription serviceDescription,
			ServiceHostBase serviceHostBase,
			Collection<ServiceEndpoint> endpoints,
			BindingParameterCollection bindingParameters)
		{
		}
开发者ID:matteomigliore,项目名称:HSDK,代码行数:7,代码来源:DependencyServiceBehavior.cs

示例5: AddBindingParameters

 /// <summary>
 /// 
 /// </summary>
 /// <param name="contractDescription"></param>
 /// <param name="endpoint"></param>
 /// <param name="bindingParameters"></param>
 public void AddBindingParameters(
     ContractDescription contractDescription,
     ServiceEndpoint endpoint,
     BindingParameterCollection bindingParameters)
 {
     // empty
 }
开发者ID:enzo3m,项目名称:DistributedComputing-WCF,代码行数:13,代码来源:ProcessingInstanceProvider.cs

示例6: AddBindingParameters

 public void AddBindingParameters(ServiceDescription serviceDescription,
                                  ServiceHostBase serviceHostBase,
                                  System.Collections.ObjectModel.Collection<ServiceEndpoint> endpoints,
                                  BindingParameterCollection bindingParameters)
 {
     //no-op
 }
开发者ID:aschryvercc,项目名称:Project-BIO,代码行数:7,代码来源:ContextBehaviourAttribute.cs

示例7:

		void IServiceBehavior.AddBindingParameters (
			ServiceDescription description,
			ServiceHostBase serviceHostBase,
			Collection<ServiceEndpoint> endpoints,
			BindingParameterCollection parameters)
		{
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:ServiceMetadataBehavior.cs

示例8: ArgumentNullException

		void IEndpointBehavior.AddBindingParameters (ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
		{
			if (endpoint == null)
				throw new ArgumentNullException ("endpoint");
			if (bindingParameters == null)
				throw new ArgumentNullException ("bindingParameters");
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:DiscoveryEndpointPublisherBehavior.cs

示例9: BuildProxyBehavior

        internal static ClientRuntime BuildProxyBehavior(ServiceEndpoint serviceEndpoint, out BindingParameterCollection parameters)
        {
            parameters = new BindingParameterCollection();
            SecurityContractInformationEndpointBehavior.ClientInstance.AddBindingParameters(serviceEndpoint, parameters);

            AddBindingParameters(serviceEndpoint, parameters);

            ContractDescription contractDescription = serviceEndpoint.Contract;
            ClientRuntime clientRuntime = new ClientRuntime(contractDescription.Name, contractDescription.Namespace);
            clientRuntime.ContractClientType = contractDescription.ContractType;

            IdentityVerifier identityVerifier = serviceEndpoint.Binding.GetProperty<IdentityVerifier>(parameters);
            if (identityVerifier != null)
            {
                clientRuntime.IdentityVerifier = identityVerifier;
            }

            for (int i = 0; i < contractDescription.Operations.Count; i++)
            {
                OperationDescription operation = contractDescription.Operations[i];

                if (!operation.IsServerInitiated())
                {
                    DispatcherBuilder.BuildProxyOperation(operation, clientRuntime);
                }
                else
                {
                    DispatcherBuilder.BuildDispatchOperation(operation, clientRuntime.CallbackDispatchRuntime);
                }
            }

            DispatcherBuilder.ApplyClientBehavior(serviceEndpoint, clientRuntime);
            return clientRuntime;
        }
开发者ID:shijiaxing,项目名称:wcf,代码行数:34,代码来源:DispatcherBuilder.cs

示例10: Use

		public void Use ()
		{
			var b = new ServiceDiscoveryBehavior ();
			b.AnnouncementEndpoints.Add (new UdpAnnouncementEndpoint ());
			IServiceBehavior sb = b;
			var host = new ServiceHost (new Uri ("http://localhost:37564"));

			var bc = new BindingParameterCollection ();
			sb.AddBindingParameters (host.Description, host, host.Description.Endpoints, bc);
			Assert.AreEqual (0, bc.Count, "#1");

			Assert.AreEqual (0, host.Extensions.Count, "#2-1");
			sb.Validate (host.Description, host);
			// ... should "validate" not "apply dispatch behavior" do "add host extension" job? I doubt that.
			Assert.AreEqual (1, host.Extensions.Count, "#2-2");
			var dse = host.Extensions.Find<DiscoveryServiceExtension> ();
			Assert.IsNotNull (dse, "#2-3");
			Assert.AreEqual (0, dse.PublishedEndpoints.Count, "#2-4");

			Assert.AreEqual (0, host.ChannelDispatchers.Count, "#3-1");
			sb.ApplyDispatchBehavior (host.Description, host);
			Assert.AreEqual (0, host.Description.Endpoints.Count, "#3-2");
			Assert.AreEqual (2, host.ChannelDispatchers.Count, "#3-3"); // for online and offline announcements
			Assert.AreEqual (0, dse.PublishedEndpoints.Count, "#3-4"); // discovery endpoints are not "published"
			int idx = 0;
			foreach (var cdisb in host.ChannelDispatchers) {
				var cdis = cdisb as ChannelDispatcher;
				string head = "#4." + idx + ".";
				Assert.IsNull (cdis, head + "dispatcher");
				if (cdisb.Listener != null)
					Assert.AreEqual ("urn:schemas-microsoft-org:ws:2008:07:discovery", cdisb.Listener.Uri.ToString (), head + "uri");
				// else ... WHOA! .NET "OnlineAnnouncementChannelDispatcher" type does not seem to provide the listener.
				idx++;
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:35,代码来源:ServiceDiscoveryBehaviorTest.cs

示例11: AddBindingParameters

 public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
 {
     foreach (var operation in endpoint.Contract.Operations)
     {
         operation.Behaviors.Add(this);
     }
 }
开发者ID:ArildF,项目名称:linqtwit,代码行数:7,代码来源:PoxBehavior.cs

示例12:

 /// <summary>
 /// Adds the binding parameters.
 /// </summary>
 /// <param name="description">The description.</param>
 /// <param name="serviceHostBase">The service host base.</param>
 /// <param name="endpoints">The endpoints.</param>
 /// <param name="parameters">The parameters.</param>
 void IServiceBehavior.AddBindingParameters(ServiceDescription description, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection parameters)
 {
     if (throttlingBehavior != null)
     {
         ((IServiceBehavior)throttlingBehavior).AddBindingParameters(description, serviceHostBase, endpoints, parameters);
     }
 }
开发者ID:ChristianWeyer,项目名称:Thinktecture.ServiceModel,代码行数:14,代码来源:InstancePoolingBehavior.cs

示例13: AddBindingParameters

 /// <summary>
 /// Provides the ability to pass custom data to binding elements to support the contract implementation.
 /// </summary>
 /// <param name="serviceDescription">
 /// The service description of the service.
 /// </param>
 /// <param name="serviceHostBase">
 /// The host of the service.
 /// </param>
 /// <param name="endpoints">
 /// The service endpoints.
 /// </param>
 /// <param name="bindingParameters">
 /// Custom objects to which binding elements have access.
 /// </param>
 public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
 {
     foreach (ChannelDispatcher chanDisp in serviceHostBase.ChannelDispatchers)
     {
         chanDisp.ErrorHandlers.Add(new ErrorHandler(this._messageFaultBuilder));
     }
 }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:22,代码来源:SdmxErrorServiceBehaviour.cs

示例14: AddBindingParameters

 public virtual void AddBindingParameters(ServiceDescription serviceDescription,
                                          ServiceHostBase serviceHostBase,
                                          Collection<ServiceEndpoint> endpoints,
                                          BindingParameterCollection bindingParameters)
 {
     throw new NotImplementedException();
 }
开发者ID:devworker55,项目名称:Mammatus,代码行数:7,代码来源:ServiceBehaviorBase.cs

示例15: NotImplementedException

		void IContractBehavior.AddBindingParameters (
			ContractDescription description,
			ServiceEndpoint endpoint,
			BindingParameterCollection parameters)
		{
			throw new NotImplementedException ();
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:DeliveryRequirementsAttribute.cs


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