[omniORB] Question about corba ping method
何立佳
helijia21 at gmail.com
Wed Nov 7 05:11:53 GMT 2018
Hi dear team:
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
#u2000 client
import os,sys
idl_path = os.getcwd()+"\\HW_U2000_IDL"
sys.path.append(idl_path) ## append idl path,windows
from omniORB import CORBA
argv = ["-ORBInitRef", "NameService=corbaname::100.100.100.100:12001"]
*# 100.100.100.100 is the u2000 ip address*
orb = CORBA.ORB_init(argv, CORBA.ORB_ID) # orb init
# get name service tree
name_service_obj = orb.resolve_initial_references("NameService")
name_service_root = name_service_obj._narrow(CosNaming.NamingContext)
# hw tree
import CosNaming
hw_name = [CosNaming.NameComponent("TMF_MTNM", "Class"),
CosNaming.NameComponent("HUAWEI", "Vendor"),
CosNaming.NameComponent("Huawei/U2000", "EmsInstance"),
CosNaming.NameComponent("2.0", "Version"),
CosNaming.NameComponent("Huawei/U2000", "EmsSessionFactory_I")]
# get tree obj
hw_obj = name_service_root.resolve(hw_name)
import nmsSession__POA
from emsSessionFactory import EmsSessionFactory_I
# try to login
emsSessionFactory_I = self.hw_obj._narrow(EmsSessionFactory_I)
nmsSession_I = nmsSession__POA.NmsSession_I()
emsSession= emsSessionFactory_I.getEmsSession(U2000_USER, U2000_PASS,
nmsSession_I._this())
# emsSession is the u2000 corba session, the i can use this obj to
call the remote function
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
the u2000 server must to callback the ping() method in the
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
I google about this and i see a demo write by java and it works, so i
am confusing which step i miss .
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 https://my.oschina.net/dong706/blog/1785625
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
i am new to corba ,and i hope get some advice from dear team. Thanks!
PS this is the part that i dont know how write by python
try {
*// 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;*
} catch (Exception ex) {}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20181107/f4e9697c/attachment.html>
More information about the omniORB-list
mailing list