public static bool Ping() { ServiceUserClient client = null; try { client = new ServiceUserClient(); client.Open(); return(client.Ping()); } catch (Exception ex) { throw ex; } finally { if (client != null) { if (client.State == CommunicationState.Faulted) { client.Abort(); } else { client.Close(); } } } }