Exemple #1
0
        public bool PingPanorama(string folderPath, string username, string password)
        {
            try
            {
                var uri = PanoramaUtil.Call(ServerUri, "targetedms", folderPath, "autoQCPing", "", true);

                using (var webClient = new WebClient())
                {
                    webClient.Headers.Add(HttpRequestHeader.Authorization, Server.GetBasicAuthHeader(username, password));
                    webClient.UploadString(uri, PanoramaUtil.FORM_POST, string.Empty);
                }
            }
            catch (WebException ex)
            {
                var response = ex.Response as HttpWebResponse;
                if (response != null && response.StatusCode == HttpStatusCode.NotFound)
                {
                    return(false);
                }
                else
                {
                    throw;
                }
            }
            return(true);
        }
Exemple #2
0
        public bool PingPanorama(string folderPath, string username, string password)
        {
            try
            {
                var uri = PanoramaUtil.Call(ServerUri, "targetedms", folderPath, "autoQCPing", "", true);

                using (var webClient = new WebClientWithCredentials(ServerUri, username, password))
                {
                    webClient.Post(uri, null);
                }
            }
            catch (WebException ex)
            {
                var response = ex.Response as HttpWebResponse;
                if (response != null && response.StatusCode == HttpStatusCode.NotFound)
                {
                    return(false);
                }
                else
                {
                    throw;
                }
            }
            return(true);
        }