static void Main(string[] args)
        {
            int    length = 0;
            Client client = new Client();

            Console.Write("\n  Testing Client Demo");
            string url = "http://localhost:8080/FileService";

            Console.Write("\n  Client of File Transfer Service");
            Console.Write("\n =================================\n");

            IFileService fs = null;

            while (true)
            {
                try
                {
                    fs = CreateChannel(url);
                    break;
                }
                catch
                {
                    Console.Write("\n  connection to service failed {0} times - trying again", ++length);
                    Thread.Sleep(500);
                    continue;
                }
            }
            Console.Write("\n  Connected to {0}\n", url);
            string storedlocation = "Sending";


            string location = Path.GetFullPath(storedlocation);

            Console.Write("\n  retrieving files from\n  {0}\n", location);
            string[] files = Directory.GetFiles(location);
            foreach (string file in files)
            {
                string filename = Path.GetFileName(file);
                Console.Write("\n  sending file {0}", filename);
                if (!sending(fs, file))
                {
                    Console.Write("\n  could not send file");
                }
            }
            Console.Write("\n\n");
            Message msg = client.makeMessage("Manjunath", client.endPoint, client.endPoint);     msg = client.makeMessage("Manjunath", client.endPoint, client.endPoint);

            msg.body = MessageTest.makeTestRequest();
            client.comm.sndr.PostMessage(msg);
            string remoteEndPoint = Comm <Client> .makeEndPoint("http://localhost", 8080);

            msg    = msg.copy_();
            msg.to = remoteEndPoint;
            client.comm.sndr.PostMessage(msg);
            Console.ReadKey();
            Message msg1 = client.results();

            client.showMsg(msg1);
            Console.Write("\n  received query: \"{0}\"", client.messge());
            msg.time  = DateTime.Now;
            client.m += "\n  " + client.comm.name + " sent message:";
            client.m += msg.showMsg();
            Console.WriteLine("{0}", client.m);
            client.wait();
        }