static void Main(string[] args) { ServiceClient client = new ServiceClient(); try { client.Open(); writeConsole(client.GetData(3)); client.Close(); } catch { } System.Threading.Thread.Sleep(5000); }