private Create ( |
||
discoveryUrl | ||
configuration | ||
리턴 |
/// <summary> /// Creates a binding for to use for discovering servers. /// </summary> /// <param name="discoveryUrl">The discovery URL.</param> /// <param name="endpointConfiguration">The endpoint configuration.</param> /// /// <param name="applicationConfiguration">The application configuration.</param> /// <returns></returns> public static DiscoveryClient Create( Uri discoveryUrl, EndpointConfiguration endpointConfiguration, ApplicationConfiguration applicationConfiguration) { if (endpointConfiguration == null) { endpointConfiguration = EndpointConfiguration.Create(); } // check if application configuration contains instance certificate. X509Certificate2 clientCertificate = null; try { if (applicationConfiguration != null && applicationConfiguration.SecurityConfiguration != null && applicationConfiguration.SecurityConfiguration.ApplicationCertificate != null) { clientCertificate = applicationConfiguration.SecurityConfiguration.ApplicationCertificate.Find(true).Result; } } catch { //ignore errors } ITransportChannel channel = DiscoveryChannel.Create(discoveryUrl, endpointConfiguration, new ServiceMessageContext(), clientCertificate); return(new DiscoveryClient(channel)); }
/// <summary> /// Creates a binding for to use for discovering servers. /// </summary> /// <param name="discoveryUrl">The discovery URL.</param> /// <returns></returns> public static DiscoveryClient Create(Uri discoveryUrl) { EndpointConfiguration configuration = EndpointConfiguration.Create(); ITransportChannel channel = DiscoveryChannel.Create(discoveryUrl, configuration, new ServiceMessageContext()); return(new DiscoveryClient(channel)); }
/// <summary> /// Creates a binding for to use for discovering servers. /// </summary> public static DiscoveryClient Create( ApplicationConfiguration application, Uri discoveryUrl) { var configuration = EndpointConfiguration.Create(); ITransportChannel channel = DiscoveryChannel.Create(application, discoveryUrl, configuration, new ServiceMessageContext()); return new DiscoveryClient(channel); }
/// <summary> /// Creates a binding for to use for discovering servers. /// </summary> public static DiscoveryClient Create( ITransportWaitingConnection connection, EndpointConfiguration configuration) { if (configuration == null) { configuration = EndpointConfiguration.Create(); } ITransportChannel channel = DiscoveryChannel.Create(null, connection, configuration, new ServiceMessageContext()); return new DiscoveryClient(channel); }
/// <summary> /// Creates a binding for to use for discovering servers. /// </summary> public static DiscoveryClient Create( ApplicationConfiguration application, Uri discoveryUrl, EndpointConfiguration configuration) { if (configuration == null) { configuration = EndpointConfiguration.Create(); } ITransportChannel channel = DiscoveryChannel.Create(application, discoveryUrl, configuration, application.CreateMessageContext()); return new DiscoveryClient(channel); }
/// <summary> /// Creates a binding for to use for discovering servers. /// </summary> /// <param name="discoveryUrl">The discovery URL.</param> /// <param name="bindingFactory">The binding factory.</param> /// <param name="configuration">The configuration.</param> /// <returns></returns> public static DiscoveryClient Create(Uri discoveryUrl, BindingFactory bindingFactory, EndpointConfiguration configuration) { if (discoveryUrl == null) { throw new ArgumentNullException("discoveryUrl"); } if (bindingFactory == null) { bindingFactory = BindingFactory.Default; } if (configuration == null) { configuration = EndpointConfiguration.Create(); } ITransportChannel channel = DiscoveryChannel.Create(discoveryUrl, bindingFactory, configuration, new ServiceMessageContext()); return(new DiscoveryClient(channel)); }