Archived
This forum has been archived. Please start a new discussion on GitHub.
Calling proxy methods in a python server
Can I use the proxy object to call methods from the Session Object. I thought I would be able to do something like proxy.getName(), where the proxy would be a reference to a session object with a getName method.
import SessionTest
from SessionI import *
class SessionFactoryI(SessionTest.SessionFactory):
def __init__(self):
self.sessions = []
print "Session Factory Created"
def create(self, Name_, IceCurrent_):
session = SessionI(Name_)
proxy = SessionTest.SessionPrx.uncheckedCast(IceCurrent_.adapter.addWithUUID(session));
#print session.getName(IceCurrent_)
self.sessions.append(proxy)
return proxy
Jeffrey M. Einhorn
jeinhorn@fourscorellc.com
952.253.6300
import SessionTest
from SessionI import *
class SessionFactoryI(SessionTest.SessionFactory):
def __init__(self):
self.sessions = []
print "Session Factory Created"
def create(self, Name_, IceCurrent_):
session = SessionI(Name_)
proxy = SessionTest.SessionPrx.uncheckedCast(IceCurrent_.adapter.addWithUUID(session));
#print session.getName(IceCurrent_)
self.sessions.append(proxy)
return proxy
Jeffrey M. Einhorn
jeinhorn@fourscorellc.com
952.253.6300
0
Comments
-
Please see this thread regarding our support policy here on these forums:
http://www.zeroc.com/vbulletin/showthread.php?t=16970 -
Hi Jeff,
Thanks for updating your signature.
As of Ice for Python 2.1.2, you cannot use a proxy to invoke an operation on a "collocated" servant (i.e., a servant registered in an object adapter created by the same communicator as the proxy).
This limitation will be fixed in the next release. Meanwhile, you can invoke directly on the servant, as in session.getName().
Take care,
- Mark0