Ejemplo n.º 1
0
        /// <summary>
        /// Returns true of the web service client is able to successfully connect to the target web service.
        /// </summary>
        /// <returns></returns>
        public bool CheckConnection()
        {
            bool result = false;

            using (SearchClient client = new SearchClient())
            {
                ConfigureClient(client);
                try
                {
                    client.Open();
                    result = client.CheckConnection();
                    client.Close();
                }
                catch (Exception ex)
                {
                    client.Abort();
                    throw ex;
                }
            }
            return(result);
        }