Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / Bug_2678_Regression / client.cs
blob29a8886a93efcbda572b0e54ff2bb582f120e47d
1 using System.Collections;
2 using System.Collections.Generic;
3 using System.Runtime.Remoting;
4 using System.Runtime.Remoting.Channels;
5 using Ch.Elca.Iiop;
6 using Ch.Elca.Iiop.Idl;
7 using Ch.Elca.Iiop.Services;
8 using System;
9 using System.IO;
11 public class ConsoleApp
13 public static void Main(string[] args)
15 if(args.Length != 1)
17 Console.WriteLine("Usage: client.exe server.ior");
18 return;
21 MappingConfiguration.Instance.UseBoxedInAny = false;
23 IDictionary props = new Hashtable();
24 IiopChannel channel = new IiopChannel(props);
25 ChannelServices.RegisterChannel(channel, false);
27 StreamReader sr = new StreamReader(args[0]);
28 string ior = sr.ReadLine();
30 Test test = (Test)RemotingServices.Connect(typeof(Test), ior);
31 object[] p = new object[2];
32 for(int i = 0; i < p.Length; ++i)
34 Container container;
35 Inner inner;
36 inner.value1 = 1 + i;
37 inner.value2 = 2 + i;
38 inner.value3 = 3 + i;
39 inner.value4 = 4 + i;
40 inner.value5 = 5 + i;
41 container.contents = inner;
42 p[i] = container;
45 try
47 p = test.RunTest(p);
49 for(int i = 0; i < p.Length; ++i)
51 if(p[i] is Container)
53 Inner inner = (Inner)((Container)p[i]).contents;
54 Console.WriteLine("[{0}]: {1} {2} {3} {4} {5}", i,
55 inner.value1, inner.value2, inner.value3, inner.value4, inner.value5);
58 test.shutdown ();
60 catch(Exception ex)
62 Console.WriteLine("Invoke failed: {0}", ex.ToString());