Exemplo n.º 1
0
        public static void Main(String[] args)
        {
            // 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);

            TestExceptionServiceImpl testExService = new TestExceptionServiceImpl();

            RemotingServices.Marshal(testExService, "testExService");

            RemotingConfiguration.RegisterWellKnownServiceType(typeof(TestWellKnownService),
                                                               "testSingleCall",
                                                               WellKnownObjectMode.SingleCall
                                                               );

            RemotingConfiguration.RegisterWellKnownServiceType(typeof(TestWellKnownService),
                                                               "testSingletonCall",
                                                               WellKnownObjectMode.Singleton
                                                               );
            TestContextBoundService contextBound = new TestContextBoundService();

            RemotingServices.Marshal(contextBound, "testContextBound");

            TestIdlTypesServiceImpl testIdlTypesService = new TestIdlTypesServiceImpl();

            RemotingServices.Marshal(testIdlTypesService, "testIdlTypesService");

            TestOneWayServiceImpl testOneWayService = new TestOneWayServiceImpl();

            RemotingServices.Marshal(testOneWayService, "testOneWayService");

            TestServiceWithCallbackImpl testServiceWithCallback = new TestServiceWithCallbackImpl();

            RemotingServices.Marshal(testServiceWithCallback, "testServiceWithCallback");

            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }
Exemplo n.º 2
0
        public static void Main(String[] args) {
            // 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);
            
            TestExceptionServiceImpl testExService = new TestExceptionServiceImpl();
            RemotingServices.Marshal(testExService, "testExService");

            RemotingConfiguration.RegisterWellKnownServiceType(typeof(TestWellKnownService),
                                                               "testSingleCall",
                                                               WellKnownObjectMode.SingleCall 
                                                              );

            RemotingConfiguration.RegisterWellKnownServiceType(typeof(TestWellKnownService),
                                                               "testSingletonCall",
                                                               WellKnownObjectMode.Singleton 
                                                              );
            TestContextBoundService contextBound = new TestContextBoundService();
            RemotingServices.Marshal(contextBound, "testContextBound");            

            TestIdlTypesServiceImpl testIdlTypesService = new TestIdlTypesServiceImpl();
            RemotingServices.Marshal(testIdlTypesService, "testIdlTypesService");

            TestOneWayServiceImpl testOneWayService = new TestOneWayServiceImpl();
            RemotingServices.Marshal(testOneWayService, "testOneWayService");

            TestServiceWithCallbackImpl testServiceWithCallback = new TestServiceWithCallbackImpl();
            RemotingServices.Marshal(testServiceWithCallback, "testServiceWithCallback");

            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }