Beispiel #1
0
        static void Main(string[] args)
        {
            localhost.Service1Client s = new localhost.Service1Client("MyTcpBinding_IService1");
            Console.WriteLine(s.GetData(10));
            localhost.CompositeType c1 = new localhost.CompositeType();
            c1.BoolValue   = false;
            c1.StringValue = "test";
            var c2 = s.GetDataUsingDataContract(c1);

            Console.WriteLine(c2.BoolValue + ", " + c2.StringValue);

            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            //using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
            {
                localhost.Service1Client proxy = new localhost.Service1Client();
                int count = 1;
                proxy.SendMessage($"This is {count} message from client.");
                count++;
                proxy.SendMessage($"This is {count} message from client.");
                count++;
                proxy.SendMessage($"This is {count} message from client.");
                count++;
                proxy.SendMessage($"This is {count} message from client.");
                count++;
                proxy.SendMessage($"This is {count} message from client.");

                //ts.Complete();
            }
        }
Beispiel #3
0
 static void Main(string[] args)
 {
     using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
     {
         Console.WriteLine("Pushing messages to DemoTx msmq queue");
         localhost.Service1Client proxy = new localhost.Service1Client();
         int count;
         count = 1;
         proxy.SendMessage(string.Format("This is {0} message from client", count));
         count = 2;
         proxy.SendMessage(string.Format("This is {0} message from client", count));
         count = 3;
         proxy.SendMessage(string.Format("This is {0} message from client", count));
         count = 4;
         proxy.SendMessage(string.Format("This is {0} message from client", count));
         count = 5;
         proxy.SendMessage(string.Format("This is {0} message from client", count));
         ts.Complete();
         Console.WriteLine("Pushed messages to DemoTx msmq queue");
     }
 }