/// <summary> /// Initializes a new instance of the <see cref="WebDomainClient<TContract>"/> class. /// </summary> /// <param name="serviceUri">The domain service Uri</param> /// <param name="usesHttps">A value indicating whether the client should contact /// the service using an HTTP or HTTPS scheme. /// </param> /// <param name="domainClientFactory">The domain client factory that creates channels to communicate with the server.</param> /// <exception cref="ArgumentNullException"> is thrown if <paramref name="serviceUri"/> /// is null. /// </exception> /// <exception cref="ArgumentException"> is thrown if <paramref name="serviceUri"/> /// is absolute and <paramref name="usesHttps"/> is true. /// </exception> public WebDomainClient(Uri serviceUri, bool usesHttps, WcfDomainClientFactory domainClientFactory) { if (serviceUri == null) { throw new ArgumentNullException(nameof(serviceUri)); } if (domainClientFactory == null) { throw new ArgumentNullException(nameof(domainClientFactory)); } #if !SILVERLIGHT if (!serviceUri.IsAbsoluteUri) { // Relative URIs currently only supported on Silverlight throw new ArgumentException(Resource.WebDomainClient_InvalidServiceUri, nameof(serviceUri)); } #endif this._serviceUri = serviceUri; this.UsesHttps = usesHttps; this.WebDomainClientFactory = domainClientFactory; #if SILVERLIGHT // The domain client should not be initialized at design time if (!System.ComponentModel.DesignerProperties.IsInDesignTool) { this.Initialize(); } #endif }
public SoapEndpointBehavior(WcfDomainClientFactory factory) { _soapQueryInspector = new QueryInspector(); _cookieInspector = factory.SharedCookieMessageInspector; }