示例#1
0
        public void TestPassingWStringAsAny()
        {
            // explicit mapping
            OrbServices orb = OrbServices.GetSingleton();
            string      arg = "test";

            omg.org.CORBA.TypeCode wstringTC = orb.create_wstring_tc(0);
            Any any = new Any(arg, wstringTC);

            string result = (string)m_testService.EchoAny(any);

            Assert.AreEqual(arg, result);

            // improved implicit mapping (in case of any, don't map to boxed wstringvalue.
            string result2 = (string)m_testService.EchoAny(arg);

            Assert.AreEqual(arg, result2);

            // check extraction on server side with implicit mapping
            string result3 = m_testService.ExtractFromWStringAny(arg);

            Assert.AreEqual(arg, result3);
        }