本文整理汇总了C#中System.ServiceModel.Description.ServiceEndpoint类的典型用法代码示例。如果您正苦于以下问题:C# ServiceEndpoint类的具体用法?C# ServiceEndpoint怎么用?C# ServiceEndpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceEndpoint类属于System.ServiceModel.Description命名空间,在下文中一共展示了ServiceEndpoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ExportEndpointTest
public void ExportEndpointTest ()
{
WsdlExporter we = new WsdlExporter ();
ServiceEndpoint se = new ServiceEndpoint (ContractDescription.GetContract (typeof (IEchoService)));
se.Binding = new BasicHttpBinding ();
se.Address = new EndpointAddress ("http://localhost:8080");
//TEST Invalid name: 5se.Name = "Service#1";
//se.Name = "Service0";
//se.ListenUri = new Uri ("http://localhost:8080/svc");
we.ExportEndpoint (se);
MetadataSet ms = we.GetGeneratedMetadata ();
Assert.AreEqual (6, ms.MetadataSections.Count);
CheckContract_IEchoService (ms, "#eet01");
WSServiceDescription sd = GetServiceDescription (ms, "http://tempuri.org/", "ExportEndpointTest");
CheckServicePort (GetService (sd, "service", "ExportEndpointTest"),
"BasicHttpBinding_IEchoService", new XmlQualifiedName ("BasicHttpBinding_IEchoService", "http://tempuri.org/"),
"http://localhost:8080/", "#eet02");
CheckBasicHttpBinding (sd, "BasicHttpBinding_IEchoService", new XmlQualifiedName ("IEchoService", "http://myns/echo"),
"Echo", "http://myns/echo/IEchoService/Echo", true, true, "#eet03");
}
开发者ID:nlhepler,项目名称:mono,代码行数:25,代码来源:WsdlExporterTest.cs
示例2: ExportPolicy
protected internal PolicyConversionContext ExportPolicy(ServiceEndpoint endpoint)
{
Contract.Requires(endpoint != null);
Contract.Ensures(Contract.Result<System.ServiceModel.Description.PolicyConversionContext>() != null);
return default(PolicyConversionContext);
}
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:7,代码来源:System.ServiceModel.Description.MetadataExporter.cs
示例3: 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
示例4: ApplyClientBehavior
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
if (clientRuntime != null && clientRuntime.CallbackDispatchRuntime != null && clientRuntime.CallbackDispatchRuntime.UnhandledDispatchOperation != null)
{
clientRuntime.CallbackDispatchRuntime.UnhandledDispatchOperation.Invoker = new UnhandledActionOperationInvoker();
}
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:UdpContractFilterBehavior.cs
示例5: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
foreach (var operation in endpoint.Contract.Operations.Where(o => Methods.Contains(o.Name)))
{
operation.Behaviors.Find<DataContractSerializerOperationBehavior>().DataContractSurrogate = new JavascriptCallbackSurrogate(callbackFactory);
}
}
开发者ID:Creo1402,项目名称:CefSharp,代码行数:7,代码来源:JavascriptCallbackEndpointBehavior.cs
示例6: ApplyClientBehavior
/// <summary>
///
/// </summary>
/// <param name="contractDescription"></param>
/// <param name="endpoint"></param>
/// <param name="clientRuntime"></param>
public void ApplyClientBehavior(
ContractDescription contractDescription,
ServiceEndpoint endpoint,
ClientRuntime clientRuntime)
{
// empty
}
开发者ID:enzo3m,项目名称:DistributedComputing-WCF,代码行数:13,代码来源:ProcessingInstanceProvider.cs
示例7: ApplyClientBehavior
/// <summary>
/// Injects the user agent into the service request.
/// </summary>
/// <param name="endpoint">The enpoint of the service for which to set the user-agent.</param>
/// <param name="clientRuntime">The client runtime.</param>
public override void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
base.ApplyClientBehavior(endpoint, clientRuntime);
CookieMessageInspector cmiInspector = new CookieMessageInspector(m_dicAuthenticationCookies);
clientRuntime.MessageInspectors.Add(cmiInspector);
}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:12,代码来源:CookieEndpointBehaviour.cs
示例8: ValidateEndpoint
void IEndpointBehavior.Validate(ServiceEndpoint endpoint)
{
if (endpoint == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpoint");
ValidateEndpoint(endpoint);
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:PartialTrustValidationBehavior.cs
示例9: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
{
var behavior =
dispatchRuntime.ChannelDispatcher.Host.Description.FindBehavior
<WebAuthenticationConfigurationBehavior,
WebAuthenticationConfigurationAttribute>(b => b.BaseBehavior);
if (behavior == null)
behavior = contractDescription.FindBehavior
<WebAuthenticationConfigurationBehavior,
WebAuthenticationConfigurationAttribute>(b => b.BaseBehavior);
if (behavior == null)
throw new ServiceAuthenticationConfigurationMissingException();
var authorizationBehavior =
dispatchRuntime.ChannelDispatcher.Host.Description.FindBehavior
<WebAuthorizationConfigurationBehavior,
WebAuthorizationConfigurationAttribute>(b => b.BaseBehavior);
Type authorizationPolicy = null;
if (authorizationBehavior != null)
authorizationPolicy = authorizationBehavior.AuthorizationPolicyType;
foreach (var endpointDispatcher in dispatchRuntime.ChannelDispatcher.Endpoints)
endpointDispatcher.DispatchRuntime.MessageInspectors.Add(
new ServiceAuthenticationInspector(
behavior.ThrowIfNull().AuthenticationHandler,
behavior.UsernamePasswordValidatorType,
behavior.RequireSecureTransport,
behavior.Source,
authorizationPolicy));
}
开发者ID:wildart,项目名称:WcfRestContrib,代码行数:33,代码来源:ServiceAuthenticationBehavior.cs
示例10: MethodInfoOperationSelector
void IContractBehavior.ApplyDispatchBehavior(ContractDescription description, ServiceEndpoint endpoint, DispatchRuntime dispatch)
{
if (dispatch.ClientRuntime != null)
{
dispatch.ClientRuntime.OperationSelector = new MethodInfoOperationSelector(description, MessageDirection.Output);
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:OperationSelectorBehavior.cs
示例11: GetRequestClientFormatter
protected override IClientMessageFormatter GetRequestClientFormatter(OperationDescription operationDescription, ServiceEndpoint endpoint)
{
if (operationDescription.Behaviors.Find<WebGetAttribute>() != null)
{
// no change for GET operations
return base.GetRequestClientFormatter(operationDescription, endpoint);
}
else
{
WebInvokeAttribute wia = operationDescription.Behaviors.Find<WebInvokeAttribute>();
if (wia != null)
{
if (wia.Method == "HEAD")
{
// essentially a GET operation
return base.GetRequestClientFormatter(operationDescription, endpoint);
}
}
}
if (operationDescription.Messages[0].Body.Parts.Count == 0)
{
// nothing in the body, still use the default
return base.GetRequestClientFormatter(operationDescription, endpoint);
}
return new NewtonsoftJsonClientFormatter(operationDescription, endpoint);
}
开发者ID:GusLab,项目名称:WCFSamples,代码行数:28,代码来源:NewtonsoftJsonBehavior.cs
示例12: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
foreach (var operation in endpointDispatcher.DispatchRuntime.Operations)
{
operation.CallContextInitializers.Add(_callContextInitializer);
}
}
开发者ID:khaledm,项目名称:wcffacilitytest,代码行数:7,代码来源:TestEndpointBehavior.cs
示例13: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
foreach (var errorHandler in errorHandlers)
{
endpointDispatcher.ChannelDispatcher.ErrorHandlers.Add(errorHandler);
}
}
开发者ID:dohansen,项目名称:Windsor,代码行数:7,代码来源:WcfErrorBehavior.cs
示例14: ApplyClientBehavior
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
foreach (var errorHandler in errorHandlers)
{
clientRuntime.CallbackDispatchRuntime.ChannelDispatcher.ErrorHandlers.Add(errorHandler);
}
}
开发者ID:dohansen,项目名称:Windsor,代码行数:7,代码来源:WcfErrorBehavior.cs
示例15: OrationiSlave
public OrationiSlave()
{
Binding binding = new NetTcpBinding(SecurityMode.None);
EndpointAddress defaultEndpointAddress = new EndpointAddress("net.tcp://localhost:57344/Orationi/Master/v1/");
EndpointAddress discoveredEndpointAddress = DiscoverMaster();
ContractDescription contractDescription = ContractDescription.GetContract(typeof(IOrationiMasterService));
ServiceEndpoint serviceEndpoint = new ServiceEndpoint(contractDescription, binding, discoveredEndpointAddress ?? defaultEndpointAddress);
var channelFactory = new DuplexChannelFactory<IOrationiMasterService>(this, serviceEndpoint);
try
{
channelFactory.Open();
}
catch (Exception ex)
{
channelFactory?.Abort();
}
try
{
_masterService = channelFactory.CreateChannel();
_communicationObject = (ICommunicationObject)_masterService;
_communicationObject.Open();
}
catch (Exception ex)
{
if (_communicationObject != null && _communicationObject.State == CommunicationState.Faulted)
_communicationObject.Abort();
}
}
开发者ID:Rankcore,项目名称:Orationi,代码行数:30,代码来源:OrationiSlave.cs
示例16: InvalidOperationException
void IEndpointBehavior.ApplyDispatchBehavior(ServiceEndpoint serviceEndpoint, EndpointDispatcher endpointDispatcher)
{
if (endpointDispatcher.DispatchRuntime.ReleaseServiceInstanceOnTransactionComplete)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxNoBatchingForReleaseOnComplete)));
if (serviceEndpoint.Contract.SessionMode == SessionMode.Required)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxNoBatchingForSession)));
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:TransactedBatchingBehavior.cs
示例17: 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
示例18: MethodAndUriTemplateOperationSelector
public MethodAndUriTemplateOperationSelector(ServiceEndpoint endpoint)
{
if (endpoint == null)
{
throw new ArgumentNullException("endpoint");
}
this.delegates =
new Dictionary<string, UriTemplateOperationSelector>();
var operations = endpoint.Contract.Operations.Select(od => new HttpOperationDescription(od));
foreach (var methodGroup in operations.GroupBy(od => od.GetWebMethod()))
{
UriTemplateTable table = new UriTemplateTable(endpoint.ListenUri);
foreach (var operation in methodGroup)
{
UriTemplate template = new UriTemplate(operation.GetUriTemplateString());
table.KeyValuePairs.Add(
new KeyValuePair<UriTemplate, object>(template, operation.Name));
}
table.MakeReadOnly(false);
UriTemplateOperationSelector templateSelector =
new UriTemplateOperationSelector(table);
this.delegates.Add(methodGroup.Key, templateSelector);
}
}
开发者ID:AlexZeitler,项目名称:WcfHttpMvcFormsAuth,代码行数:29,代码来源:MethodAndUriTemplateOperationSelector.cs
示例19: ApplyDispatchBehavior
/// <summary>
///
/// </summary>
/// <param name="contractDescription"></param>
/// <param name="endpoint"></param>
/// <param name="dispatchRuntime">The runtime object that can be used to modify the default service behavior.</param>
public void ApplyDispatchBehavior(
ContractDescription contractDescription,
ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
dispatchRuntime.InstanceProvider = this; // set the provider to manage service objects instantiation
}
开发者ID:enzo3m,项目名称:DistributedComputing-WCF,代码行数:13,代码来源:ProcessingInstanceProvider.cs
示例20: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ServiceEndpoint serviceEndpoint, EndpointDispatcher endpointDispatcher)
{
if (serviceEndpoint == null)
throw new ArgumentNullException("serviceEndpoint");
if (endpointDispatcher == null)
throw new ArgumentNullException("endpointDispatcher");
// Apply URI-based operation selector
Dictionary<string, string> operationNameDictionary = new Dictionary<string, string>();
foreach (OperationDescription operation in serviceEndpoint.Contract.Operations)
{
try
{
operationNameDictionary.Add(operation.Name.ToLower(), operation.Name);
}
catch (ArgumentException)
{
throw new Exception(String.Format("The specified contract cannot be used with case insensitive URI dispatch because there is more than one operation named {0}", operation.Name));
}
}
endpointDispatcher.AddressFilter = new PrefixEndpointAddressMessageFilter(serviceEndpoint.Address);
endpointDispatcher.ContractFilter = new MatchAllMessageFilter();
endpointDispatcher.DispatchRuntime.OperationSelector = new UriPathSuffixOperationSelector(serviceEndpoint.Address.Uri, operationNameDictionary);
}
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:25,代码来源:EnableHttpGetRequestsBehavior.cs
注:本文中的System.ServiceModel.Description.ServiceEndpoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论