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


C# Description.ServiceEndpoint类代码示例

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


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


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