Beispiel #1
0
        public static void Main(String[] args)
        {
            IOrbServices orb = OrbServices.GetSingleton();

            orb.OverrideDefaultCharSets(CharSet.UTF8, WCharSet.UTF16);

            // register the channel
            int         port = 8087;
            IiopChannel chan = new IiopChannel(port);

            ChannelServices.RegisterChannel(chan, false);

            TestService test      = new TestService();
            string      objectURI = "test";

            RemotingServices.Marshal(test, objectURI);

            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }
        public void TestOverrideCodeSetsWhenAlreadySet()
        {
            TaggedComponent defaultComponent =
                CodeSetService.CreateDefaultCodesetComponent(m_codec);
            CodeSetComponentData codeSetData = (CodeSetComponentData)
                                               m_codec.decode_value(defaultComponent.component_data,
                                                                    CodeSetComponentData.TypeCode);

            Assert.IsTrue(Enum.IsDefined(typeof(CharSet), codeSetData.NativeCharSet));
            Assert.IsTrue(Enum.IsDefined(typeof(WCharSet), codeSetData.NativeWCharSet));

            IOrbServices orbServices = OrbServices.GetSingleton();

            try
            {
                orbServices.OverrideDefaultCharSets(CharSet.UTF8, WCharSet.UTF16);
                Assert.Fail("expected bad_inv_order exception");
            }
            catch (BAD_INV_ORDER)
            {
                // expected, because already set
            }
        }
 static void Main(string[] args)
 {
     IOrbServices orb = OrbServices.GetSingleton();
     orb.OverrideDefaultCharSets(CharSet.UTF8, WCharSet.UTF16);
     orb.RegisterPortableInterceptorInitalizer(new MyOrbInitializer());
     orb.CompleteInterceptorRegistration();