View Single Post
  #1 (permalink)  
Old 11-16-2005
JavaJack JavaJack is offline
Registered User
 
 
Join Date: Nov 2005
Posts: 2
Python interactive mode - invalid value for element 0

I'm trying to mimic the simple printer example, with my own dummy.ice file:

module Dummy {
struct geo {
int tsn;
string geographicvalue;
string updatedate;
string dummy;
};
sequence<geo> geolist;
interface geoops {
geolist getgeolist();
};
};

Then I tried to create a server and client in two separate python interactive prompts by following the same steps as simpleprinter:

SERVER:
>>> import Ice
>>> i = Ice.initialize()
>>> Ice.loadSlice("dummy.ice")
>>> import Dummy
>>> class geoopsi(Dummy.geoops):
... def getgeolist(self, current=None):
... return (1,"geoval", "1/1/1", "x")
>>> a = i.createObjectAdapterWithEndpoints("geoadapter", "default -p 10000")
>>> s = geoopsi()
>>> a.add(s, Ice.stringToIdentity("crap"))
crap -t:tcp -h 192.168.1.100 -p 10000
>>> a.activate()


CLIENT:
>>> import Ice
>>> Ice.loadSlice("dummy.ice")
>>> import Dummy
>>> i = Ice.initialize()
>>> b = i.stringToProxy("crap:default -p 10000")
>>> d = Dummy.geoopsPrx.checkedCast(b)
>>> d.getgeolist()


ERROR:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "dummy.ice", line 78, in getgeolist

Ice.UnknownException: exception ::Ice::UnknownException
{
unknown = exceptions.ValueError: invalid value for element 0 of `::Dummy::geolist'
}

I must be overlooking something simple, can anyone spot the problem?

One odd thing is that I _can_ call the function in the server's cmd window:
>>> s.getgeolist()
(1, 'geoval', '1/1/1', 'x')
__________________
R. Alan Monroe
Home user
http://javajack.dynalias.net/
Reply With Quote