Пример #1
0
        static void Main(string[] args)
        {
            var client = new ServerServiceClient("BasicHttpBinding_IServerService", "http://localhost:8000/ServerService");

            client.Test("test text");
            var sessionName = GetSessionName();

            client.StoreSession(sessionName);
            Console.WriteLine(client.GetSessionName());

            client.SendByteData(new byte[100000]);
            client.SendString(sessionName);

            Console.WriteLine("Uploaded");

            Console.ReadLine();
            client.Close();
        }
Пример #2
0
        static void Main(string[] args)
        {
            //To add ServerServiceClient use
            //svcutil.exe http://localhost:8000/ServerService?wsdl
            //OR easier way
            //To add new right click on project "Add Service Reference"
            //Update right click on "Service References->ServiceReference1" then "Update Service Reference"
            ServerServiceClient client = new ServerServiceClient("BasicHttpBinding_IServerService", "http://localhost:8000/ServerService");
            var result = client.Test("test text");

            Console.WriteLine("Session Name:");
            var sessionName = Console.ReadLine();

            client.StoreSession(sessionName);
            Console.WriteLine(client.GetSessionName());
            Console.ReadLine();

            client.SendByteData(new byte[100000]);
            Console.WriteLine("Uploaded");

            Console.ReadLine();
            client.Close();
        }