Beispiel #1
0
        /// <summary>
        /// 取门诊单据费用明细(退费前用)
        /// </summary>
        /// <param name="mzlsh">门诊流水号</param>
        /// <param name="djh"></param>
        /// <param name="theMZFY"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public bool GetMZFYMX(string mzlsh, string djh, out MZFYDetail[] theMZFY, out string errMsg)
        {
            IiopClientChannel channel = new IiopClientChannel();

            try
            {
                NamingContext   nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), strior);
                NameComponent[] name        = new NameComponent[] { new NameComponent("MZYL", "Service") };
                intMZ           mz          = (intMZ)nameService.resolve(name);
                short[]         res         = mz.GetMZFYMX(yljgbm, mzlsh, djh, czybm, czy, out theMZFY);
                ChannelServices.UnregisterChannel(channel);
                string resStr = TransSAToString(res);
                if (resStr.StartsWith(SUCCESS))
                {
                    errMsg = string.Empty;
                    return(true);
                }
                else
                {
                    errMsg = resStr.Substring(resStr.IndexOf(")") + 1);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                ChannelServices.UnregisterChannel(channel);
                if (isSaveExceptionLog)
                {
                    //DataLog.SaveLog(String.Format("GetMZFYMX:{0}\n", ex.Message));
                }
                errMsg  = EXCEPTION;
                theMZFY = null;
                return(false);
            }
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            try {
                string nameServiceHost = "localhost";
                int    nameServicePort = 1050;
                parseArgs(ref nameServiceHost, ref nameServicePort, args);

                Console.WriteLine("input the two summands");
                Console.WriteLine("sum1:");
                double sum1 = Double.Parse(Console.ReadLine());
                Console.WriteLine("sum2:");
                double sum2 = Double.Parse(Console.ReadLine());

                // register the channel
                IiopClientChannel channel = new IiopClientChannel();
                ChannelServices.RegisterChannel(channel, false);

                // access COS nameing service
                CorbaInit       init        = CorbaInit.GetInit();
                NamingContext   nameService = init.GetNameService(nameServiceHost, nameServicePort);
                NameComponent[] name        = new NameComponent[] { new NameComponent("adder", "") };
                // get the reference to the adder
                Adder adder = (Adder)nameService.resolve(name);
                // call add
                double result = adder.add(sum1, sum2);
                Console.WriteLine("result: " + result);
            } catch (Exception e) {
                Console.WriteLine("exception: " + e);
            }
        }
Beispiel #3
0
        public static void Main(string[] args)
        {
            try {
                string nameserviceLoc = "corbaloc::localhost:3528/JBoss/Naming/root";
                if (args.Length > 0)
                {
                    nameserviceLoc = args[0];
                }

                IiopClientChannel channel = new IiopClientChannel();
                ChannelServices.RegisterChannel(channel, false);

                NamingContext nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), nameserviceLoc);

                NameComponent[] name = new NameComponent[] { new NameComponent("demo", ""),
                                                             new NameComponent("commandTargetHome", "") };
                // get the command target home interface
                CommandTargetHome home          = (CommandTargetHome)nameService.resolve(name);
                CommandTarget     commandTarget = home.create();

                Application.Run(new Commandform(commandTarget));
            } catch (Exception e) {
                Console.WriteLine("exception: " + e);
            }
        }
Beispiel #4
0
        /// <summary>
        /// 取个人基本信息
        /// </summary>
        /// <param name="ylzh">医疗证号(解析前)</param>
        /// <param name="mm">医疗证号密码</param>
        /// <param name="theGRXX">个人基本信息</param>
        /// <param name="errMsg">异常信息</param>
        /// <returns></returns>
        public bool GetGRXBXX(string ylzh, string mm, out GRXX theGRXX, out string errMsg)
        {
            System.Collections.IDictionary dic = new System.Collections.Hashtable();
            //dic.Add(IiopClientChannel.ALLOW_REQUEST_MULTIPLEX_KEY,"9");
            //dic.Add(IiopClientChannel.CLIENT_CONNECTION_LIMIT_KEY,30000);
            //dic.Add(IiopClientChannel.CLIENT_RECEIVE_TIMEOUT_KEY, 30000);
            //dic.Add(IiopClientChannel.CLIENT_REQUEST_TIMEOUT_KEY, 30000);
            //dic.Add(IiopClientChannel.CLIENT_SEND_TIMEOUT_KEY, 30000);
            //dic.Add(IiopClientChannel.CLIENT_UNUSED_CONNECTION_KEEPALIVE_KEY, "3");
            //dic.Add(IiopClientChannel.MAX_NUMBER_OF_MULTIPLEXED_REQUESTS_KEY, "3");
            //dic.Add(IiopClientChannel.MAX_NUMBER_OF_RETRIES_KEY, "3");
            //dic.Add(IiopClientChannel.RETRY_DELAY_KEY,30000);

            dic.Add(IiopClientChannel.CLIENT_RECEIVE_TIMEOUT_KEY, 30000); //30s
            dic.Add(IiopClientChannel.CLIENT_REQUEST_TIMEOUT_KEY, 30000); //30s
            dic.Add(IiopClientChannel.CLIENT_SEND_TIMEOUT_KEY, 30000);    //30s

            IiopClientChannel channel = new IiopClientChannel(dic);

            try
            {
                if (string.IsNullOrEmpty(mm))
                {
                    mm = "";
                }
                ChannelServices.RegisterChannel(channel, false);
                NamingContext   nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), strior);
                NameComponent[] name        = new NameComponent[] { new NameComponent("MZYL", "Service") };
                intMZ           mz          = (intMZ)nameService.resolve(name);
                short[]         res         = mz.GetGRJBXX(yljgbm, ylzh, mm, czybm, czy, out theGRXX);
                ChannelServices.UnregisterChannel(channel);
                string resStr = TransSAToString(res);
                if (resStr.StartsWith(SUCCESS))
                {
                    ////DataLog.SaveLog("获取患者医保个人信息成功");
                    errMsg = string.Empty;
                    return(true);
                }
                else
                {
                    if (isSaveExceptionLog)
                    {
                        ////DataLog.SaveLog(String.Format("GetGRXBXX:{0}\n", resStr));
                    }
                    errMsg = resStr.Substring(resStr.IndexOf(")") + 1);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                ChannelServices.UnregisterChannel(channel);
                if (isSaveExceptionLog)
                {
                    ////DataLog.SaveLog(String.Format("GetGRXBXX:{0}\n", ex.Message));
                }
                errMsg  = EXCEPTION;
                theGRXX = new GRXX();
                return(false);
            }
        }
Beispiel #5
0
        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();
        }
Beispiel #6
0
        public static void Main(string[] args)
        {
            try {
                string host = "localhost";
                int    port = 8087;
                parseArgs(ref host, ref port, args);

                Console.WriteLine("input the two summands");
                Console.WriteLine("sum1:");
                double sum1 = Double.Parse(Console.ReadLine());
                Console.WriteLine("sum2:");
                double sum2 = Double.Parse(Console.ReadLine());

                // register the channel
                IiopClientChannel channel = new IiopClientChannel();
                ChannelServices.RegisterChannel(channel, false);

                // get the reference to the adder
                Adder adder = (Adder)RemotingServices.Connect(typeof(Adder), "iiop://" + host + ":" + port + "/adder");
                // call add
                double result = adder.add(sum1, sum2);
                Console.WriteLine("result: " + result);
            } catch (Exception e) {
                Console.WriteLine("exception: " + e);
            }
        }
Beispiel #7
0
        public static void Main(string[] args)
        {
            try {
                string nameServiceHost = "localhost";
                int    nameServicePort = 1050;
                parseArgs(ref nameServiceHost, ref nameServicePort, args);

                // register the channel
                IiopClientChannel channel = new IiopClientChannel();
                ChannelServices.RegisterChannel(channel, false);

                // access COS naming service
                CorbaInit       init        = CorbaInit.GetInit();
                NamingContext   nameService = init.GetNameService(nameServiceHost, nameServicePort);
                NameComponent[] name        = new NameComponent[] { new NameComponent("service", "") };
                // get the reference to the adder
                Service service = (Service)nameService.resolve(name);
                // call fail
                service.fail();
            } catch (CustomEx je) {
                Console.WriteLine("Java-side exception: {0}\nReason: {1}", je.value.message, je.value.reason);
            } catch (Exception e) {
                Console.WriteLine("exception: " + e);
            }
        }
Beispiel #8
0
        public static void Main(string[] args)
        {
            try {
                string nameserviceLoc = "corbaloc::localhost:8091/StandardNS/NameServer-POA/_root";
                if (args.Length > 0)
                {
                    nameserviceLoc = args[0];
                }

                Console.WriteLine("input the two summands");
                Console.WriteLine("sum1:");
                double sum1 = Double.Parse(Console.ReadLine());
                Console.WriteLine("sum2:");
                double sum2 = Double.Parse(Console.ReadLine());

                // register the channel
                IiopClientChannel channel = new IiopClientChannel();
                ChannelServices.RegisterChannel(channel, false);

                // get reference to nameservice
                NamingContext nc = (NamingContext)RemotingServices.Connect(typeof(NamingContext), nameserviceLoc);

                // get the reference to the adder
                Adder adder =
                    (Adder)nc.resolve(new NameComponent[] { new NameComponent("Adder") });
                // call add
                double result = adder.add(sum1, sum2);
                Console.WriteLine("result: " + result);
            } catch (Exception e) {
                Console.WriteLine("exception: " + e);
            }
        }
Beispiel #9
0
 private void Destroy()
 {
     mz          = null;
     sys         = null;
     nameService = null;
     ChannelServices.UnregisterChannel(channel);
     channel = null;
 }
Beispiel #10
0
 public void TearDown()
 {
     if (m_clientChannel != null)
     {
         ChannelServices.UnregisterChannel(m_clientChannel);
     }
     m_clientChannel = null;
 }
Beispiel #11
0
        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");
        }
Beispiel #12
0
        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);
        }
Beispiel #13
0
        public void SetupEnvironment()
        {
            // register the channel
            IDictionary props = new Hashtable();

            props[IiopClientChannel.CLIENT_REQUEST_TIMEOUT_KEY] = 1000;
            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:1.2@localhost:8087/test");
        }
Beispiel #14
0
        public void SetUp()
        {
            m_orb = OrbServices.GetSingleton();

            m_profile =
                new InternetIiopProfile(new GiopVersion(1, 2),
                                        "localhost",
                                        1001,
                                        new byte[] { 1, 0, 0, 0 });

            m_clientChannel = new IiopClientChannel();
            ChannelServices.RegisterChannel(m_clientChannel, false);
        }
        public static void Main(string[] args)
        {
            try {
                // register the channel
                IiopClientChannel channel = new IiopClientChannel();
                ChannelServices.RegisterChannel(channel);

                Object obj = new Object();
                try {
                    // access COS naming Service
                    NamingContext nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), "corbaloc::localhost:2809/NameService");
                    Console.WriteLine("Got reference to nameService");

                    // get the reference to the Graph
                    NameComponent[] name = new NameComponent[] { new NameComponent("Foo", "Test") };
                    Console.WriteLine("About to resolve Foo.Test");
                    obj = (DataFlowGraph)nameService.resolve(name);
                    Console.WriteLine("Got reference to graph");
                } catch (NotFound e) {
                    Console.WriteLine("Could not find graph in NameService");
                    return;
                } catch (TRANSIENT e) {
                    Console.WriteLine("Could not contact NameService");
                    return;
                }

                if (obj == null)
                {
                    Console.WriteLine("Reference to graph is null...");
                    return;
                }

                DataFlowGraph  graph           = (DataFlowGraph)obj;
                KeyValuePair[] sink_attributes = new KeyValuePair[] { new KeyValuePair("name", "CORBA.Sink01") };
                Console.WriteLine("About to create node");
                Node sink = (Node)graph.create_node("CORBASink", sink_attributes);
                Console.WriteLine("Created CORBA sink node");
                Node[] nodes = graph.get_nodes();
                foreach (Node n in nodes)
                {
                    Console.WriteLine(n.get_attribute("ID"));
                }
            } catch (NotFound e) {
                Console.WriteLine("Could not find graph in NameService");
            } catch (TRANSIENT e) {
                Console.WriteLine("Could not contact graph");
            } catch (Exception e) {
                Console.WriteLine("exception: " + e);
            }
        }
Beispiel #16
0
        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 #17
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_newTestService = m_testService.ReturnNewTestService();
        }
Beispiel #18
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 #19
0
        public void SetupEnvironment()
        {
            // register the channel
            m_channel = new IiopClientChannel();
            ChannelServices.RegisterChannel(m_channel, false);

            // access COS nameing service
            RmiIiopInit init = new RmiIiopInit("localhost", 7001);

            m_nameService = init.GetNameService();
            NameComponent[] name = new NameComponent[] { new NameComponent("IntegrationTest", ""), new NameComponent("test", "") };
            // get the reference to the test-home
            TestHome testhome = (TestHome)m_nameService.resolve(name);

            m_test = testhome.create();
        }
Beispiel #20
0
        public static void Main(string[] args)
        {
            try {
                string nameServiceHost = "localhost";
                int    nameServicePort = 1050;
                parseArgs(ref nameServiceHost, ref nameServicePort, args);

                // register the channel
                IiopClientChannel channel = new IiopClientChannel();
                ChannelServices.RegisterChannel(channel, false);

                // access COS nameing service
                RmiIiopInit   init        = new RmiIiopInit(nameServiceHost, nameServicePort);
                NamingContext nameService = init.GetNameService();

                // test value object:
                Console.WriteLine("testing value object");
                NameComponent[] name = new NameComponent[] { new NameComponent("ch.elca.iiop.demo.valueObjectDemo.ValueObjDemoHome", "") };
                // get the reference to the ValObjectDemo-home
                ValObjectDemoHome valDemoHome = (ValObjectDemoHome)nameService.resolve(name);
                // create valObjectDemo
                ValObjectDemo valDemo = valDemoHome.create();
                // call retrieveValObject
                Console.WriteLine("calling retrieveValObject");
                ValObject resultVal = valDemo.retrieveValObject();
                Console.WriteLine("test-string: " + resultVal.testString);
                Console.WriteLine("test-int: " + resultVal.testValue);

                // call echoValObject
                Console.WriteLine("calling echoValObject");
                ValObject toSend = new ValObjectImpl();
                Console.WriteLine("input string: ");
                toSend.testString = Console.ReadLine();
                Console.WriteLine("input int: ");
                toSend.testValue = Int32.Parse(Console.ReadLine());
                Console.WriteLine("result of echo: ");
                ValObject echo = valDemo.echoValObject(toSend);
                Console.WriteLine("echo-string: " + echo.testString);
                Console.WriteLine("echo-value: " + echo.testValue);


                // Dispose the EJB
                valDemo.remove();
            } catch (Exception e) {
                Console.WriteLine("exception: " + e);
            }
        }
Beispiel #21
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 #22
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 #23
0
        public static void Main(string[] args)
        {
            try {
                Console.WriteLine("input the two summands");
                Console.WriteLine("sum1:");
                double sum1 = Double.Parse(Console.ReadLine());
                Console.WriteLine("sum2:");
                double sum2 = Double.Parse(Console.ReadLine());

                string fileName = @"..\server\ior";
                if (args.Length > 0)
                {
                    fileName = args[0];
                }
                TextReader reader = new StreamReader(fileName);
                string     ior    = reader.ReadLine();
                reader.Close();
                Console.WriteLine("use ior: " + ior.ToString());

                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";

                // register the channel
                IiopClientChannel channel = new IiopClientChannel(props);
                ChannelServices.RegisterChannel(channel, false);

                // get the reference to the adder
                Adder adder = (Adder)RemotingServices.Connect(typeof(Adder), ior);
                // call add
                double result = adder.add(sum1, sum2);
                Console.WriteLine("result: " + result);
            } catch (Exception e) {
                Console.WriteLine("exception: " + e);
            }
        }
Beispiel #24
0
        public void SetupEnvironment()
        {
            // register the channel
            m_channel = new IiopClientChannel();
            ChannelServices.RegisterChannel(m_channel, false);

            // access COS nameing service
            string nameserviceLoc = "corbaloc::localhost:3528/JBoss/Naming/root";

            m_nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), nameserviceLoc);

            NameComponent[] name = new NameComponent[] { new NameComponent("IntegrationTest", ""),
                                                         new NameComponent("test", "") };
            // get the reference to the test-home
            TestHome testhome = (TestHome)m_nameService.resolve(name);

            m_test = testhome.create();
        }
    static void Main(string[] args)
    {
        IiopClientChannel channel = new IiopClientChannel();

        ChannelServices.RegisterChannel(channel, false);
        CorbaInit     init    = CorbaInit.GetInit();
        NamingContext context = init.GetNameService("MYLICSRV", 30000);

        NameComponent[] names = new NameComponent[] { new NameComponent("B1LicenseInfo") };
        ILicenseInfo    li    = (ILicenseInfo)context.resolve(names);

        byte[] hwKey;
        byte[] instNum;
        li.GetHardwareKey(out hwKey);
        li.GetInstallationNumberList(out instNum);
        Encoding encoding = new System.Text.UnicodeEncoding(false, false, true);

        Console.WriteLine(encoding.GetString(hwKey));
        Console.WriteLine(encoding.GetString(instNum));
    }
Beispiel #26
0
        private void SetupSslChannel()
        {
            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] =
                "JBoss Server IIOP.NET it-test";

            m_channel = new IiopClientChannel(props);
            // register the channel
            ChannelServices.RegisterChannel(m_channel, false);
        }
Beispiel #27
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();
        }
Beispiel #28
0
        public void SetupEnvironment()
        {
            // register the channel
            m_channel = new IiopClientChannel();
            ChannelServices.RegisterChannel(m_channel, false);

            // access COS nameing service
            CorbaInit     init        = CorbaInit.GetInit();
            NamingContext nameService = init.GetNameService("localhost", 1050);

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

            try {
                CustomMapperRegistry reg = CustomMapperRegistry.GetSingleton();
                reg.AddMappingsFromFile(new FileInfo("customMapping.xml"));
                reg.AddMappingsFromFile(new FileInfo("customMappingTest.xml"));
            } catch (Exception e) {
                Console.WriteLine("custom mapper not loadable: " + e);
                throw e;
            }
        }
Beispiel #29
0
        private void Init()
        {
            // 建立并注册IIOP通道,与服务器corba进行通信
            if (channel == null)
            {
                channel = new IiopClientChannel();
                ChannelServices.RegisterChannel(channel, false);
            }

            //本地corba初始化
            //string nameserviceLoc = "corbaloc::61.144.253.81:10000/StandardNS/NameServer-POA/_root";
            //CorbaInit init = CorbaInit.GetInit();
            //ior文件中内容,也可从ior文件中读取
            string ior = "IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F6E746578744578743A312E300000000000020000000000000074000102000000000E36312E3134342E3235332E38310027100000001F5374616E646172644E532F4E616D655365727665722D504F412F5F726F6F7400000000020000000000000008000000004A414300000000010000001C00000000000100010000000105010001000101090000000105010001000000010000002C0000000000000001000000010000001C00000000000100010000000105010001000101090000000105010001";

            //Ior iorobj = new Ior(ior);
            //IInternetIiopProfile iiopProf = (IInternetIiopProfile)iorobj.Profiles[0];

            //根据ior字符串获取对方命名服务
            nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), ior);
            //RmiIiopInit init = new RmiIiopInit("61.144.253.81", 10000);
            //NamingContext nameService = (NamingContext)init.GetService("StandardNS/NameServer-POA/_root");
            //NamingContext nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), nameserviceLoc);
        }