public static void Main(String[] args) {

            IOrbServices orb = OrbServices.GetSingleton();
            TestInterceptorInit testInterceptorInit = new TestInterceptorInit();
            orb.RegisterPortableInterceptorInitalizer(testInterceptorInit);

            // register the channel
            int port = 8087;
            IiopChannel chan = new IiopChannel(port);
            ChannelServices.RegisterChannel(chan, false);

            orb.CompleteInterceptorRegistration();

            TestInterceptorControlService controlService = 
                new TestInterceptorControlService(testInterceptorInit);
            string objectURIControlService = "interceptorControl";
            RemotingServices.Marshal(controlService, objectURIControlService);

            TestService test = new TestService();
            string objectURI = "test";
            RemotingServices.Marshal(test, objectURI);
            
            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }
        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");            

            TestBoxedValuetypeServiceImpl testBoxedService = new TestBoxedValuetypeServiceImpl();
            RemotingServices.Marshal(testBoxedService, "testBoxedService");

            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }
        public void SetupEnvironment() {
            // register the channel
            IDictionary props = new Hashtable();
            props[IiopChannel.CHANNEL_NAME_KEY] = "IiopClientChannelSsl";
            props[IiopChannel.TRANSPORT_FACTORY_KEY] =
               "Ch.Elca.Iiop.Security.Ssl.SslTransportFactory,SSLPlugin";
            
            props[SslTransportFactory.CLIENT_AUTHENTICATION] = 
                "Ch.Elca.Iiop.Security.Ssl.ClientMutualAuthenticationSuitableFromStore,SSLPlugin";
            // take certificates from the windows certificate store of the current user
            props[ClientMutualAuthenticationSuitableFromStore.STORE_LOCATION] =
                "CurrentUser";
            // the expected CN property of the server key
            props[DefaultClientAuthenticationImpl.EXPECTED_SERVER_CERTIFICATE_CName] = 
                "IIOP.NET demo server";
            props[IiopClientChannel.ALLOW_REQUEST_MULTIPLEX_KEY] = false;
            
            // register the channel
            m_channel = new IiopClientChannel(props);
            ChannelServices.RegisterChannel(m_channel, false);

            // get the reference to the test-service
            m_testService = (TestService)RemotingServices.Connect(typeof(TestService), 
                            "corbaloc:iiop-ssl:1.2@localhost:8087/test");

            m_newTestService = m_testService.ReturnNewTestService();
        }
        public static void Main(String[] args) {
            // register the channel            
            IDictionary props = new Hashtable();
            props[IiopChannel.CHANNEL_NAME_KEY] = "securedServerIiopChannel";            
            props[IiopServerChannel.PORT_KEY] = "8087";            
            props[IiopChannel.TRANSPORT_FACTORY_KEY] = 
                "Ch.Elca.Iiop.Security.Ssl.SslTransportFactory,SSLPlugin";
 
            props[SslTransportFactory.SERVER_REQUIRED_OPTS] = "96";
            props[SslTransportFactory.SERVER_SUPPORTED_OPTS] = "96";
            props[SslTransportFactory.SERVER_AUTHENTICATION] = 
                "Ch.Elca.Iiop.Security.Ssl.DefaultServerAuthenticationImpl,SSLPlugin";

            props[DefaultServerAuthenticationImpl.SERVER_CERTIFICATE] = 
                "5f4abc1aad19e53857be2a4bbec9297091f0082c";                   

            props[DefaultServerAuthenticationImpl.STORE_LOCATION] = "CurrentUser";

            IiopChannel chan = new IiopChannel(props);
            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 SetupEnvironment() {
            // register the channel
            m_channel = new IiopClientChannel();
            ChannelServices.RegisterChannel(m_channel, false);

            // get the reference to the test-service
            m_testService = (TestService)RemotingServices.Connect(typeof(TestService), "corbaloc:iiop:1.2@localhost:8087/test");
        }
 public void SetupEnvironment() {
     // register the channel
     IDictionary props = new Hashtable();
     props[IiopServerChannel.PORT_KEY] = 0;
     m_channel = new IiopChannel(props);
     ChannelServices.RegisterChannel(m_channel, false);
     // get the reference to the test-service
     m_testService = (TestService)RemotingServices.Connect(typeof(TestService), "corbaloc:iiop:1.2@localhost:8087/test");
 }
        public void SetupEnvironment() {
            // register the channel
            m_channel = new IiopClientChannel();
            ChannelServices.RegisterChannel(m_channel, false);

            NamingContext nameService = GetNameService();
            NameComponent[] name = new NameComponent[] { new NameComponent("test", "") };
            // get the reference to the test-service
            m_testService = (TestService)nameService.resolve(name);
        }
        public void SetupEnvironment() {
            // register the channel
            IDictionary properties = new Hashtable();
            properties[IiopClientChannel.ALLOW_REQUEST_MULTIPLEX_KEY] = false;
            m_channel = new IiopClientChannel(properties);
            ChannelServices.RegisterChannel(m_channel, false);

            // get the reference to the test-service
            m_testService = (TestService)RemotingServices.Connect(typeof(TestService), "corbaloc:iiop:1.2@localhost:8087/test");

            m_newTestService = m_testService.ReturnNewTestService();
        }
        public void SetupEnvironment() {
            // register the channel
            m_channel = new IiopClientChannel();
            ChannelServices.RegisterChannel(m_channel, false);

            // access COS nameing service
            NamingContext nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), 
                                                                                "corbaloc::localhost:11456/NameService");
            NameComponent[] name = new NameComponent[] { new NameComponent("test", "") };
            // get the reference to the test-service
            m_testService = (TestService)nameService.resolve(name);
        }
Beispiel #10
0
        public void SetupEnvironment() {
            // register the channel
            IDictionary properties = new Hashtable();
            properties[IiopClientChannel.ALLOW_REQUEST_MULTIPLEX_KEY] = false;
            properties[IiopClientChannel.CLIENT_CONNECTION_LIMIT_KEY] = 10;
            m_channel = new IiopClientChannel(properties);
            ChannelServices.RegisterChannel(m_channel, false);

            // get the reference to the test-service
            m_testService1 = (TestService)RemotingServices.Connect(typeof(TestService), "iiop://localhost:8087/test1");
            m_testService2 = (TestService)RemotingServices.Connect(typeof(TestService), "iiop://localhost:8087/test2");
        }
Beispiel #11
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);
            
            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }
Beispiel #12
0
 public void SetupEnvironment() {
     // register the channel
     if (m_channel == null) {
         // the remote proxy for this url is bound to a certain sink chain for some time ->
         // don't recreate channel; otherwise, is no more bidirectional for another run.
         IDictionary props = new Hashtable();
         props[IiopServerChannel.PORT_KEY] = 0;
         props[IiopChannel.BIDIR_KEY] = true;
         m_channel = new IiopChannel(props);
     }
     ChannelServices.RegisterChannel(m_channel, false);
     // get the reference to the test-service
     m_testService = (TestService)RemotingServices.Connect(typeof(TestService), "corbaloc:iiop:1.2@localhost:8087/test");
 }
Beispiel #13
0
        public void SetupEnvironment() {
            if (!m_isConfigured) {
                OrbServices orb = OrbServices.GetSingleton();
                orb.SerializerFactoryConfig.StringSerializationAllowNull = true;
                orb.SerializerFactoryConfig.SequenceSerializationAllowNull = true;
                orb.SerializerFactoryConfig.ArraySerializationAllowNull = true;
                m_isConfigured = true;
            }
            // register the channel
            m_channel = new IiopClientChannel();
            ChannelServices.RegisterChannel(m_channel, false);

            // get the reference to the test-service
            m_testService = (TestService)RemotingServices.Connect(typeof(TestService), "corbaloc:iiop:1.2@localhost:8087/test");
        }
Beispiel #14
0
        public static void Main(String[] args) {
            // register the channel
            int port = 8087;
            IDictionary properties = new Hashtable();
            properties[IiopServerChannel.PORT_KEY] = port;
            IiopChannel chan = new IiopChannel(properties);
            ChannelServices.RegisterChannel(chan, false);

            TestService test = new TestService();
            string objectURI = "test";
            RemotingServices.Marshal(test, objectURI);
            
            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }
Beispiel #15
0
        public void SetupEnvironment() {
            // register the channel
            if (m_channel == null) {
                m_channel = new IiopClientChannel();
                ChannelServices.RegisterChannel(m_channel, false);

                RegisterInterceptors();

                // get the reference to the test-service
            m_testService = (TestService)RemotingServices.Connect(typeof(TestService), "corbaloc:iiop:1.2@localhost:8087/test");

                m_interceptorControl = (TestInterceptorControlService)RemotingServices.Connect(typeof(TestInterceptorControlService),
                                                                                               "corbaloc:iiop:1.2@localhost:8087/interceptorControl");
            }
        }
Beispiel #16
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);
        }
Beispiel #17
0
        public static void Main(String[] args) {
            // register the channel
            IDictionary properties = new Hashtable();
            properties[IiopServerChannel.PORT_KEY] = 8087;
            properties[IiopServerChannel.SERVERTHREADS_MAX_PER_CONNECTION_KEY] = 20;            
            IiopChannel chan = new IiopChannel(properties);
            ChannelServices.RegisterChannel(chan, false);

            TestService test1 = new TestService();
            string objectURI1 = "test1";
            RemotingServices.Marshal(test1, objectURI1);
            TestService test2 = new TestService();
            string objectURI2 = "test2";
            RemotingServices.Marshal(test2, objectURI2);

            Console.WriteLine("Server running. Press any key to stop....");
            Console.ReadLine();
        }
Beispiel #18
0
        public void SetupEnvironment() {
            // register the channel
            IDictionary properties = new Hashtable();
            properties[IiopClientChannel.ALLOW_REQUEST_MULTIPLEX_KEY] = false;
            m_channel = new IiopClientChannel(properties);
            ChannelServices.RegisterChannel(m_channel, false);

            // get the reference to the test-service
            m_testService = (TestService)RemotingServices.Connect(typeof(TestService), "corbaloc:iiop:1.2@localhost:8087/test");
            m_testExService = (TestExceptionService)RemotingServices.Connect(typeof(TestExceptionService), "corbaloc:iiop:1.2@localhost:8087/testExService");

            m_svcSingleCall = 
                (ISimpleTestInterface)RemotingServices.Connect(typeof(ISimpleTestInterface), "corbaloc:iiop:1.2@localhost:8087/testSingleCall");
            m_svcSingletonCall = 
                (ISimpleTestInterface)RemotingServices.Connect(typeof(ISimpleTestInterface), "corbaloc:iiop:1.2@localhost:8087/testSingletonCall");
            m_contextBound = 
                (ISimpleTestInterface)RemotingServices.Connect(typeof(ISimpleTestInterface), "corbaloc:iiop:1.2@localhost:8087/testContextBound");
            m_testBoxedService = (TestBoxedValuetypeService)RemotingServices.Connect(typeof(TestBoxedValuetypeService), "corbaloc:iiop:1.2@localhost:8087/testBoxedService");
        }
Beispiel #19
0
        public void SetupEnvironment() {
            MappingConfiguration.Instance.UseBoxedInAny = false; // disable boxing of string/arrays in any's
            // register the channel
            m_channel = new IiopClientChannel();
            ChannelServices.RegisterChannel(m_channel, false);

            NamingContext nameService = GetNameService();
            NameComponent[] name = new NameComponent[] { new NameComponent("test", "") };
            // get the reference to the test-service
            m_testService = (TestService)nameService.resolve(name);

            NameComponent[] nameInternal = 
                new NameComponent[] { new NameComponent("testInternal", "") };
            // get the reference to a service with a server-side only interface inherited from a public one
            m_testServiceInternalIf = 
               (TestSimpleServicePublic)nameService.resolve(nameInternal);

            m_orb = OrbServices.GetSingleton();
        }
 public bool CheckEqualityWithServiceV2(TestService toCheck) {
     return toCheck.Equals(this);
 }
Beispiel #21
0
 public void TestNonExistent() {
     NamingContext nameService = GetNameService();
     NameComponent[] name = new NameComponent[] { new NameComponent("testXYZ", "") };
     // get the reference to non-existent service
     m_testService = (TestService)nameService.resolve(name);            
 }        
Beispiel #22
0
 private void CallOctetParamsMethod(TestService serviceToUse)
 {
     System.Byte arg    = (byte)m_random.Next(100);
     System.Byte result = serviceToUse.TestIncByte(arg);
     Assertion.AssertEquals((System.Byte)(arg + 1), result);
 }
Beispiel #23
0
 private void CallNoParamsMethodSync(TestService serviceToUse)
 {
     serviceToUse.TestVoid();
 }
Beispiel #24
0
 private void CallOctetParamsMethod(TestService serviceToUse) {
     System.Byte arg = (byte)m_random.Next(100);
     System.Byte result = serviceToUse.TestIncByte(arg);
     Assertion.AssertEquals((System.Byte)(arg + 1), result);
 }
Beispiel #25
0
 private void CallLongBlocking(TestService serviceToUse)
 {
     serviceToUse.BlockForTime(400);
 }
Beispiel #26
0
 private void CallStructParamsMethodAsync(TestService serviceToUse) {
     TestStructA arg = new TestStructAImpl();
     arg.X = m_random.Next(100);
     arg.Y = -1 * m_random.Next(100);
     
     StructParamsCallDelegate scd = new StructParamsCallDelegate(serviceToUse.TestEchoStruct);
     // async call
     IAsyncResult ar = scd.BeginInvoke(arg, null, null);
     // wait for response
     TestStructA result = scd.EndInvoke(ar);
     
     Assertion.AssertEquals(arg.X, result.X);
     Assertion.AssertEquals(arg.Y, result.Y);
 }
Beispiel #27
0
 private void CallOctetParamsMethodAsync(TestService serviceToUse) {
     System.Byte arg = (byte)m_random.Next(100);
     
     ByteParamsCallDelegate bcd = new ByteParamsCallDelegate(serviceToUse.TestIncByte);
     // async call
     IAsyncResult ar = bcd.BeginInvoke(arg, null, null);
     // wait for response
     System.Byte result = bcd.EndInvoke(ar);
     Assertion.AssertEquals((System.Byte)(arg + 1), result);
 }
Beispiel #28
0
 public bool CheckEqualityWithServiceV2(TestService toCheck)
 {
     return(toCheck.Equals(this));
 }
Beispiel #29
0
 private void CallStructParamsMethod(TestService serviceToUse) {
     TestStructA arg = new TestStructAImpl();
     arg.X = m_random.Next(100);
     arg.Y = -1 * m_random.Next(100);
     TestStructA result = m_testService1.TestEchoStruct(arg);
     Assertion.AssertEquals(arg.X, result.X);
     Assertion.AssertEquals(arg.Y, result.Y);
 }
Beispiel #30
0
 public RepeatedMethodCaller(int nrOfCalls, TimeSpan delay,
                             PerformCallDelegate callPerformer,
                             TestService serviceToUse) {
     m_delay = delay;
     m_nrOfCalls = nrOfCalls;
     m_callPerformer = callPerformer;
     m_serviceToUse = serviceToUse;
 }
Beispiel #31
0
 private void CallWithCreateObject(TestService serviceToUse) {
     Adder adder = serviceToUse.RetrieveAdder();
     System.Int32 arg1 = m_random.Next(100);
     System.Int32 arg2 = m_random.Next(100);
     System.Int32 result = adder.Add(arg1, arg2);
     Assertion.AssertEquals((System.Int32) arg1 + arg2, result);
 }
Beispiel #32
0
 private void CallWithCreateObjectAsync(TestService serviceToUse) {
     RetrieveAdderDelegate rad = new RetrieveAdderDelegate(serviceToUse.RetrieveAdder);
     // async call
     IAsyncResult ar1 = rad.BeginInvoke(null, null);
     
     System.Int32 arg1 = m_random.Next(100);
     System.Int32 arg2 = m_random.Next(100);
     
     // wait for response
     Adder result1 = rad.EndInvoke(ar1);
     Assertion.AssertNotNull(result1);
                 
     AddCallDelegate acd = new AddCallDelegate(result1.Add);
     // async call
     IAsyncResult ar2 = acd.BeginInvoke(arg1, arg2, null, null);
     // wait for response
     System.Int32 result2 = acd.EndInvoke(ar2);                                                         
     Assertion.AssertEquals((System.Int32) arg1 + arg2, result2);
 }
Beispiel #33
0
 public void TearDownEnvironment()
 {
     m_testService = null;
     // unregister the channel, otherwise, get some problem with server channel data.
     ChannelServices.UnregisterChannel(m_channel);
 }
Beispiel #34
0
 public void TearDownEnvironment()
 {
     m_testService = null;
     ChannelServices.UnregisterChannel(m_channel);
 }
Beispiel #35
0
 public void TearDownEnvironment() {
     m_testService = null;
     // unregister the channel            
     ChannelServices.UnregisterChannel(m_channel);
 }
Beispiel #36
0
 private void CallLongBlocking(TestService serviceToUse) {
     serviceToUse.BlockForTime(400);
 }