<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi dear team:<div>im using the omniORB 4.2.2 / omniORBpy4.2.2 and python3 to develop a HUAWEI U2000 oss client and i got a ping failure question durring developing. i have alreay </div><div><br></div><div><pre style="color:rgb(0,0,0);font-size:12pt"><span style="font-family:Consolas;color:rgb(0,0,128);font-weight:bold">#u2000 client</span></pre><pre style="font-size:12pt"><span style="color:rgb(0,0,128);font-family:Consolas;font-weight:bold">import </span><font face="Consolas" style="color:rgb(0,0,0)">os,sys<br>idl_path = os.getcwd()+</font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"</span><span style="color:rgb(0,0,128);font-family:Consolas;font-weight:bold">\\</span><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">HW_U2000_IDL" </span><span style="color:rgb(128,128,128);font-family:Consolas;font-style:italic"><br></span><font face="Consolas" style="color:rgb(0,0,0)">sys.path.append(idl_path) ## append idl path,windows<br></font><span style="color:rgb(0,0,128);font-family:Consolas;font-weight:bold">from </span><font face="Consolas" style="color:rgb(0,0,0)">omniORB </font><span style="color:rgb(0,0,128);font-family:Consolas;font-weight:bold">import </span><font face="Consolas" style="color:rgb(0,0,0)">CORBA<br>argv = [</font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"-ORBInitRef"</span><font face="Consolas" style="color:rgb(0,0,0)">, </font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"NameService=corbaname::<a href="http://100.100.100.100:12001" target="_blank">100.100.100.100:12001</a>"</span><font face="Consolas" style="color:rgb(0,0,0)">] </font><b style="color:rgb(0,0,0)"><span style="font-family:Consolas;color:rgb(128,128,128)"># 100.100.100.100 </span><span style="color:rgb(128,128,128)"><font face="宋体">is the </font></span><span style="font-family:Consolas;color:rgb(128,128,128)">u2000 ip address</span></b><span style="color:rgb(128,128,128);font-family:宋体"><i><br></i></span><font face="Consolas" style="color:rgb(0,0,0)">orb = CORBA.ORB_init(argv, CORBA.ORB_ID) </font><span style="color:rgb(128,128,128);font-family:Consolas"># orb init</span><span style="color:rgb(128,128,128);font-family:宋体;font-style:italic"><br></span><span style="color:rgb(128,128,128);font-family:宋体;font-style:italic"><br></span><span style="color:rgb(128,128,128);font-family:Consolas"># get name service tree</span><span style="color:rgb(128,128,128);font-family:宋体;font-style:italic"><br></span><font face="Consolas" style="color:rgb(0,0,0)">name_service_obj = orb.resolve_initial_references(</font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"NameService"</span><font face="Consolas" style="color:rgb(0,0,0)">)<br>name_service_root = name_service_obj._narrow(CosNaming.NamingContext)<br><br></font><span style="color:rgb(128,128,128);font-family:Consolas"># hw tree</span><span style="color:rgb(128,128,128);font-family:宋体;font-style:italic"><br></span><span style="color:rgb(0,0,128);font-family:Consolas;font-weight:bold">import </span><font face="Consolas" style="color:rgb(0,0,0)">CosNaming<br>hw_name = [CosNaming.NameComponent(</font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"TMF_MTNM"</span><font face="Consolas" style="color:rgb(0,0,0)">, </font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"Class"</span><font face="Consolas" style="color:rgb(0,0,0)">),<br> CosNaming.NameComponent(</font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"HUAWEI"</span><font face="Consolas" style="color:rgb(0,0,0)">, </font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"Vendor"</span><font face="Consolas" style="color:rgb(0,0,0)">),<br> CosNaming.NameComponent(</font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"Huawei/U2000"</span><font face="Consolas" style="color:rgb(0,0,0)">, </font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"EmsInstance"</span><font face="Consolas" style="color:rgb(0,0,0)">),<br> CosNaming.NameComponent(</font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"2.0"</span><font face="Consolas" style="color:rgb(0,0,0)">, </font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"Version"</span><font face="Consolas" style="color:rgb(0,0,0)">),<br> CosNaming.NameComponent(</font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"Huawei/U2000"</span><font face="Consolas" style="color:rgb(0,0,0)">, </font><span style="color:rgb(0,128,128);font-family:Consolas;font-weight:bold">"EmsSessionFactory_I"</span><font face="Consolas" style="color:rgb(0,0,0)">)]<br><br></font><span style="color:rgb(128,128,128);font-family:Consolas"># get tree obj</span><span style="color:rgb(128,128,128);font-family:宋体;font-style:italic"><br></span><font face="Consolas" style="color:rgb(0,0,0)">hw_obj = name_service_root.resolve(hw_name)<br></font><span style="color:rgb(128,128,128);font-family:宋体;font-style:italic"><br></span><span style="color:rgb(0,0,128);font-family:Consolas;font-weight:bold">import </span><font face="Consolas" style="color:rgb(0,0,0)">nmsSession__POA<br></font><span style="color:rgb(0,0,128);font-family:Consolas;font-weight:bold">from </span><font face="Consolas" style="color:rgb(0,0,0)">emsSessionFactory </font><span style="color:rgb(0,0,128);font-family:Consolas;font-weight:bold">import </span><font face="Consolas" style="color:rgb(0,0,0)">EmsSessionFactory_I<br># try to login<br>emsSessionFactory_I = self.hw_obj._narrow(EmsSessionFactory_I)</font><span style="color:rgb(128,128,128);font-style:italic"><font face="宋体"><br></font></span><font face="Consolas" style="color:rgb(0,0,0)">nmsSession_I = nmsSession__POA.NmsSession_I()<br>emsSession= emsSessionFactory_I.getEmsSession(U2000_USER, U2000_PASS, nmsSession_I._this())<br></font><font color="#808080" face="Consolas"># emsSession is the u2000 corba session, the i can use this obj to call the remote function</font></pre><pre style="font-size:12pt"><font color="#000000" face="verdana, sans-serif">here is the question, the huawei u2000 server find that the nmsSession obj which in my python code transit to the server is wrong. I can login into the u2000 server but</font></pre><pre style="font-size:12pt"><font face="verdana, sans-serif"><font color="#000000">the u2000 server must to callback the ping() method in the </font>nmsSession_I and it get a failure. If occure the failure for 4 times ,it will force me to logout,and i can't solve this problem</font></pre><pre style="font-size:12pt"><font face="verdana, sans-serif"> I google about this and i see a demo write by java and it works, so i am confusing which step i miss .</font></pre><pre style="font-size:12pt"><font face="verdana, sans-serif">And i read the huawei idl and find that the ping() method is already in the nmsSession_I obj , here is the url that shows the working demo by java <a href="https://my.oschina.net/dong706/blog/1785625">https://my.oschina.net/dong706/blog/1785625</a></font></pre><pre style="font-size:12pt"><font face="verdana, sans-serif">By compare the client code i find that i miss the poa activating step and i still confuse about how to bind the nmsSession_I to POA to make the u2000 server can call the nmsSession_I after i login the emssession</font></pre><pre style="font-size:12pt"><font face="verdana, sans-serif">i am new to corba ,and i hope get some advice from dear team. Thanks!</font></pre><pre style="font-size:12pt">PS this is the part that i dont know how write by python</pre><pre><span style="font-size:16px">try {
                        <b><font color="#cc0000">// get reference to rootpoa & activate the POAManager
                        
                        rootpoa = POAHelper.narrow(orb
                                        .resolve_initial_references("RootPOA"));
                        rootpoa.the_POAManager().activate();
                        // create servant and register it with the ORB
                        
                        NmsSessionImpl nmsSessionImpl = new NmsSessionImpl();
                        // nmsSessionImpl.setORB(orb);
                        byte[] objectID = rootpoa.activate_object(nmsSessionImpl);
                        // create a tie, with servant being the delegate.
                        
                        NmsSession_IPOATie tie = new NmsSession_IPOATie(nmsSessionImpl,
                                        rootpoa);
                        // obtain the objectRef for the tie
                        // this step also implicitly activates the the object
                        
                        csession = tie._this(orb);
                        objects[0] = rootpoa;</font></b>
                } catch (Exception ex) {</span>}<span style="font-size:16px">
                        </span></pre></div></div></div></div>