Пример #1
0
 /// <summary>
 /// Get proxy address
 /// </summary>
 /// <returns>The proxy address and port</returns>
 protected virtual string GetProxyAddress()
 {
     return(WebServiceConfig.GetProxyAddress());
 }
Пример #2
0
 /// <summary>
 /// Get if proxy should be used
 /// </summary>
 /// <returns>True if should use proxy</returns>
 protected virtual bool GetUseProxy()
 {
     return(WebServiceConfig.GetUseProxy());
 }
Пример #3
0
 /// <summary>
 /// Get the base web service url
 /// </summary>
 /// <returns>The base web service url</returns>
 protected virtual string GetBaseWebServiceUrl()
 {
     return(WebServiceConfig.GetWebServiceUri());
 }
Пример #4
0
 /// <summary>
 /// Get a new http client
 /// </summary>
 /// <returns>A new http client</returns>
 protected virtual HttpClient GetHttpClient()
 {
     return(HttpClientFactory.GetClient(this.GetBaseWebServiceUri(), WebServiceConfig.GetWebServiceTimeout(), this.GetUseProxy(), this.GetProxyAddress()));
 }
Пример #5
0
 /// <summary>
 /// Gets a HTTP client based on configuration values
 /// </summary>
 /// <returns>A HTTP client</returns>
 public static HttpClient GetDefaultClient()
 {
     return(GetClient(new Uri(WebServiceConfig.GetWebServiceUri()), WebServiceConfig.GetWebServiceTimeout()));
 }
Пример #6
0
 /// <summary>
 /// Gets a HTTP client based on configuration values
 /// </summary>
 /// <param name="baseAddress">Base service uri</param>
 /// <param name="timeout">Web service timeout</param>
 /// <returns>A HTTP client</returns>
 public static HttpClient GetClient(Uri baseAddress, TimeSpan timeout)
 {
     return(GetClient(baseAddress, timeout, WebServiceConfig.GetUseProxy(), WebServiceConfig.GetProxyAddress()));
 }