本文整理汇总了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);
}
示例2: AddBindingParameters
public void AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters)
{
if (_innerOperationBehavior == null)
return;
(_innerOperationBehavior as IOperationBehavior).AddBindingParameters(operationDescription, bindingParameters);
}
示例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);
}
}
示例4: AddBindingParameters
public void AddBindingParameters(
ServiceDescription serviceDescription,
ServiceHostBase serviceHostBase,
Collection<ServiceEndpoint> endpoints,
BindingParameterCollection bindingParameters)
{
}
示例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
}
示例6: AddBindingParameters
public void AddBindingParameters(ServiceDescription serviceDescription,
ServiceHostBase serviceHostBase,
System.Collections.ObjectModel.Collection<ServiceEndpoint> endpoints,
BindingParameterCollection bindingParameters)
{
//no-op
}
示例7:
void IServiceBehavior.AddBindingParameters (
ServiceDescription description,
ServiceHostBase serviceHostBase,
Collection<ServiceEndpoint> endpoints,
BindingParameterCollection parameters)
{
}
示例8: ArgumentNullException
void IEndpointBehavior.AddBindingParameters (ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
{
if (endpoint == null)
throw new ArgumentNullException ("endpoint");
if (bindingParameters == null)
throw new ArgumentNullException ("bindingParameters");
}
示例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;
}
示例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++;
}
}
示例11: AddBindingParameters
public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
{
foreach (var operation in endpoint.Contract.Operations)
{
operation.Behaviors.Add(this);
}
}
示例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);
}
}
示例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));
}
}
示例14: AddBindingParameters
public virtual void AddBindingParameters(ServiceDescription serviceDescription,
ServiceHostBase serviceHostBase,
Collection<ServiceEndpoint> endpoints,
BindingParameterCollection bindingParameters)
{
throw new NotImplementedException();
}
示例15: NotImplementedException
void IContractBehavior.AddBindingParameters (
ContractDescription description,
ServiceEndpoint endpoint,
BindingParameterCollection parameters)
{
throw new NotImplementedException ();
}