本文整理汇总了C#中System.ServiceModel.Channels.Binding类的典型用法代码示例。如果您正苦于以下问题:C# Binding类的具体用法?C# Binding怎么用?C# Binding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Binding类属于System.ServiceModel.Channels命名空间,在下文中一共展示了Binding类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InfocardInteractiveChannelInitializer
public InfocardInteractiveChannelInitializer (
ClientCredentials credentials,
Binding binding)
{
this.binding = binding;
this.credentials = credentials;
}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:InfocardInteractiveChannelInitializer.cs
示例2: OnApplyConfiguration
protected override void OnApplyConfiguration(Binding binding)
{
base.OnApplyConfiguration(binding);
BasicHttpBinding bpBinding = (BasicHttpBinding)binding;
bpBinding.MessageEncoding = this.MessageEncoding;
this.Security.ApplyConfiguration(bpBinding.Security);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:BasicHttpBindingElement.cs
示例3: IssuedSecurityTokenParameters
public IssuedSecurityTokenParameters (string tokenType,
EndpointAddress issuerAddress, Binding issuerBinding)
{
token_type = tokenType;
issuer_address = issuerAddress;
binding = issuerBinding;
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:IssuedSecurityTokenParameters.cs
示例4: CreateSqlDatabaseManagementChannel
public static ISqlDatabaseManagement CreateSqlDatabaseManagementChannel(Binding binding, Uri remoteUri, X509Certificate2 cert, string requestSessionId)
{
WebChannelFactory<ISqlDatabaseManagement> factory = new WebChannelFactory<ISqlDatabaseManagement>(binding, remoteUri);
factory.Endpoint.Behaviors.Add(new ClientOutputMessageInspector(requestSessionId));
factory.Credentials.ClientCertificate.Certificate = cert;
return factory.CreateChannel();
}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:SqlDatabaseManagementHelper.cs
示例5: GetCustomBinding
//Used by live contacts channel and Solr search and RelatedItems
public static CustomBinding GetCustomBinding(Binding source)
{
CustomBinding result = new CustomBinding(source);
WebMessageEncodingBindingElement element = result.Elements.Find<WebMessageEncodingBindingElement>();
element.ContentTypeMapper = new RawMapper();
return result;
}
开发者ID:Klaudit,项目名称:inbox2_desktop,代码行数:8,代码来源:RawMapper.cs
示例6: OnApplyConfiguration
protected override void OnApplyConfiguration(Binding binding)
{
base.OnApplyConfiguration(binding);
MsmqIntegrationBinding miBinding = (MsmqIntegrationBinding) binding;
miBinding.SerializationFormat = this.SerializationFormat;
this.Security.ApplyConfiguration(miBinding.Security);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:MsmqIntegrationBindingElement.cs
示例7: GetCredentialTypeForBinding
public string GetCredentialTypeForBinding(Binding binding)
{
if (binding.Scheme.Equals("http", StringComparison.OrdinalIgnoreCase))
return "Username";
return "Certificate";
}
开发者ID:nothrow,项目名称:OrionSDK,代码行数:7,代码来源:SubscriptionServiceHost.cs
示例8: AnnouncementEndpoint
public AnnouncementEndpoint (DiscoveryVersion discoveryVersion, Binding binding, EndpointAddress address)
: base (null, binding, address)
{
if (discoveryVersion == null)
throw new ArgumentNullException ("discoveryVersion");
DiscoveryVersion = discoveryVersion;
}
开发者ID:MichaelWalsh,项目名称:mono,代码行数:7,代码来源:AnnouncementEndpoint.cs
示例9: CommunicationClient
/// <summary>
/// The constructor.
/// </summary>
/// <param name="binding">The binding.</param>
/// <param name="endpointAddress">The endpoint address.</param>
/// <param name="hostReconnectIntervalMilliseconds">The cache host reconnect interval, in milliseconds.</param>
public CommunicationClient(Binding binding, EndpointAddress endpointAddress, int hostReconnectIntervalMilliseconds)
{
// Sanitize
if (binding == null)
{
throw new ArgumentNullException("binding");
}
if (endpointAddress == null)
{
throw new ArgumentNullException("endpointAddress");
}
if (hostReconnectIntervalMilliseconds <= 0)
{
throw new ArgumentException("must be greater than 0", "hostReconnectIntervalMilliseconds");
}
// Initialize the channel factory with the binding and endpoint address
_channelFactory = new ChannelFactory<IClientToCacheContract>(binding, endpointAddress);
// Set the cache host reconnect interval
_hostReconnectIntervalMilliseconds = hostReconnectIntervalMilliseconds;
// Initialize WCF
_proxy = _channelFactory.CreateChannel();
_proxyComm = _proxy as ICommunicationObject;
// Set connected before opening to avoid a race
_isConnected = true;
// Initialize and configure the reconnect timer to never fire
_reconnectTimer = new Timer(ReconnectToServer, null, Timeout.Infinite, Timeout.Infinite);
}
开发者ID:nategreenwood,项目名称:dache,代码行数:38,代码来源:CommunicationClient.cs
示例10: GetClient
private WSRegistryServicePortTypeClient GetClient(String username, String password,
String serverURL, Binding binding)
{
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback(
delegate(object sender, X509Certificate certificate,
X509Chain chain, SslPolicyErrors policyErrors) { return true; });
AuthenticationAdminPortTypeClient authenticationAdmin =
new AuthenticationAdminPortTypeClient(binding,
new EndpointAddress(serverURL + "AuthenticationAdmin"));
using (new OperationContextScope(authenticationAdmin.InnerChannel))
{
if (!authenticationAdmin.login(username, password, "127.0.0.1"))
{
throw new SecurityException("Failed to login to system.");
}
HttpResponseMessageProperty response = (HttpResponseMessageProperty)
System.ServiceModel.OperationContext.Current.
IncomingMessageProperties[HttpResponseMessageProperty.Name];
cookie = response.Headers[HttpResponseHeader.SetCookie];
}
return new WSRegistryServicePortTypeClient(binding,
new EndpointAddress(serverURL + "WSRegistryService"));
}
开发者ID:GayanM,项目名称:product-greg,代码行数:25,代码来源:RegistryClient.cs
示例11: TryCreate
internal static bool TryCreate(SecurityBindingElement sbe, TransportBindingElement transport, PrivacyNoticeBindingElement privacy, ReliableSessionBindingElement rsbe, TransactionFlowBindingElement tfbe, out Binding binding)
{
WSFederationHttpSecurityMode mode;
WSFederationHttpSecurity security2;
bool isReliableSession = rsbe != null;
binding = null;
HttpTransportSecurity transportSecurity = new HttpTransportSecurity();
if (!WSFederationHttpBinding.GetSecurityModeFromTransport(transport, transportSecurity, out mode))
{
return false;
}
HttpsTransportBindingElement element = transport as HttpsTransportBindingElement;
if (((element != null) && (element.MessageSecurityVersion != null)) && (element.MessageSecurityVersion.SecurityPolicyVersion != WS2007MessageSecurityVersion.SecurityPolicyVersion))
{
return false;
}
if (TryCreateSecurity(sbe, mode, transportSecurity, isReliableSession, out security2))
{
binding = new WS2007FederationHttpBinding(security2, privacy, isReliableSession);
}
if ((rsbe != null) && (rsbe.ReliableMessagingVersion != ReliableMessagingVersion.WSReliableMessaging11))
{
return false;
}
if ((tfbe != null) && (tfbe.TransactionProtocol != TransactionProtocol.WSAtomicTransaction11))
{
return false;
}
return (binding != null);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:WS2007FederationHttpBinding.cs
示例12: GetTokenUIAsyncResult
internal GetTokenUIAsyncResult(Binding binding, IClientChannel channel, ClientCredentials credentials, AsyncCallback callback, object state) : base(callback, state)
{
this.credentials = credentials;
this.proxy = channel;
this.binding = binding;
this.CallBegin(true);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:GetTokenUIAsyncResult.cs
示例13: InitializeFrom
protected internal override void InitializeFrom(Binding binding)
{
base.InitializeFrom(binding);
MsmqBindingBase base2 = (MsmqBindingBase) binding;
this.DeadLetterQueue = base2.DeadLetterQueue;
if (base2.CustomDeadLetterQueue != null)
{
this.CustomDeadLetterQueue = base2.CustomDeadLetterQueue;
}
this.Durable = base2.Durable;
this.ExactlyOnce = base2.ExactlyOnce;
this.MaxReceivedMessageSize = base2.MaxReceivedMessageSize;
this.MaxRetryCycles = base2.MaxRetryCycles;
if (!base2.ReceiveContextEnabled)
{
this.ReceiveContextEnabled = base2.ReceiveContextEnabled;
}
this.ReceiveErrorHandling = base2.ReceiveErrorHandling;
this.ReceiveRetryCount = base2.ReceiveRetryCount;
this.RetryCycleDelay = base2.RetryCycleDelay;
this.TimeToLive = base2.TimeToLive;
this.UseSourceJournal = base2.UseSourceJournal;
this.UseMsmqTracing = base2.UseMsmqTracing;
if (base2.ValidityDuration != MsmqDefaults.ValidityDuration)
{
this.ValidityDuration = base2.ValidityDuration;
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:MsmqBindingElementBase.cs
示例14: TestDownloadStream
static void TestDownloadStream(string address, Binding binding)
{
ChannelFactory<IHelloWorld> channelFactory = new ChannelFactory<IHelloWorld>(binding, address);
ServicePointManager.ServerCertificateValidationCallback = (snder, cert, chain, error) => true;
channelFactory.Credentials.UserName.UserName = "h";
channelFactory.Credentials.UserName.Password = "p";
IHelloWorld client = channelFactory.CreateChannel();
((IChannel)client).Open();
Console.WriteLine("Invoking DownloadStream...");
Stream stream = client.DownloadStream();
int readResult;
int bytesRead = 0;
byte[] buffer = new byte[1000];
do
{
readResult = stream.Read(buffer, 0, buffer.Length);
bytesRead += readResult;
}
while (readResult != 0);
stream.Close();
Console.WriteLine("Read {0} bytes.", bytesRead);
((IChannel)client).Close();
}
开发者ID:v-zhidu,项目名称:WCFTraining,代码行数:28,代码来源:Program.cs
示例15: GetBindingForBinding
public string GetBindingForBinding(Binding binding)
{
if (binding.Scheme.Equals("http", StringComparison.OrdinalIgnoreCase))
return "Soap1_1";
return "NetTcp";
}
开发者ID:nothrow,项目名称:OrionSDK,代码行数:7,代码来源:SubscriptionServiceHost.cs
示例16: TryCreate
internal static bool TryCreate(BindingElementCollection bindingElements, out Binding binding)
{
if (bindingElements == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bindingElements");
}
binding = null;
ContextBindingElement element = bindingElements.Find<ContextBindingElement>();
if (element != null)
{
Binding binding2;
BindingElementCollection elements = new BindingElementCollection(bindingElements);
elements.Remove<ContextBindingElement>();
if (WSHttpBindingBase.TryCreate(elements, out binding2))
{
bool allowCookies = ((WSHttpBinding) binding2).AllowCookies;
if ((allowCookies && (element.ContextExchangeMechanism == ContextExchangeMechanism.HttpCookie)) || (!allowCookies && (element.ContextExchangeMechanism == ContextExchangeMechanism.ContextSoapHeader)))
{
WSHttpContextBinding binding3 = new WSHttpContextBinding((WSHttpBinding) binding2) {
ContextProtectionLevel = element.ProtectionLevel,
ContextManagementEnabled = element.ContextManagementEnabled
};
binding = binding3;
}
}
}
return (binding != null);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:WSHttpContextBinding.cs
示例17: ConfigureQuotas
public static void ConfigureQuotas(Binding binding, int quotaSize)
{
if (binding is BasicHttpBinding)
{
var basicHttpBinding = (BasicHttpBinding)binding;
basicHttpBinding.MaxBufferSize = quotaSize;
basicHttpBinding.MaxBufferPoolSize = quotaSize;
basicHttpBinding.MaxReceivedMessageSize = quotaSize;
ConfigureQuotas(basicHttpBinding.ReaderQuotas, quotaSize);
}
else if (binding is WSHttpBindingBase)
{
var wsHttpBinding = (WSHttpBindingBase)binding;
wsHttpBinding.MaxBufferPoolSize = quotaSize;
wsHttpBinding.MaxReceivedMessageSize = quotaSize;
ConfigureQuotas(wsHttpBinding.ReaderQuotas, quotaSize);
}
else if (binding is WebHttpBinding)
{
var webHttpBinding = (WebHttpBinding)binding;
webHttpBinding.MaxBufferSize = quotaSize;
webHttpBinding.MaxBufferPoolSize = quotaSize;
webHttpBinding.MaxReceivedMessageSize = quotaSize;
ConfigureQuotas(webHttpBinding.ReaderQuotas, quotaSize);
}
else if (binding is NetTcpBinding)
{
var netTcpBinding = (NetTcpBinding)binding;
netTcpBinding.MaxBufferSize = quotaSize;
netTcpBinding.MaxBufferPoolSize = quotaSize;
netTcpBinding.MaxReceivedMessageSize = quotaSize;
ConfigureQuotas(netTcpBinding.ReaderQuotas, quotaSize);
}
}
开发者ID:dohansen,项目名称:Windsor,代码行数:34,代码来源:WcfBindingUtils.cs
示例18: WriteBinding
internal void WriteBinding(Binding binding, out string bindingSectionName, out string configurationName)
{
BindingDictionaryValue result = CreateBindingConfig(binding);
configurationName = result.BindingName;
bindingSectionName = result.BindingSectionName;
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ConfigWriter.cs
示例19: InitializeFrom
protected internal override void InitializeFrom(Binding binding)
{
base.InitializeFrom(binding);
MsmqIntegrationBinding binding2 = (MsmqIntegrationBinding) binding;
this.SerializationFormat = binding2.SerializationFormat;
this.Security.InitializeFrom(binding2.Security);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:MsmqIntegrationBindingElement.cs
示例20: InitializeFrom
protected internal override void InitializeFrom(Binding binding)
{
base.InitializeFrom(binding);
MsmqIntegrationBinding miBinding = (MsmqIntegrationBinding) binding;
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.SerializationFormat, miBinding.SerializationFormat);
this.Security.InitializeFrom(miBinding.Security);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:MsmqIntegrationBindingElement.cs
注:本文中的System.ServiceModel.Channels.Binding类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论