[ome-devel] Python bindings when creating new service

Donald MacDonald donald.macdonald at ed.ac.uk
Fri May 11 16:58:20 BST 2012


Hi Josh,

I cannot seem to call IceImport or import it, I know that you used to use it in omero/grid/_init_.py etc, 
but I cannot find a reference to it anywhere. 

How should I use it, I am using Ice3.3.1 on Beta 4.3.3

Regards

D.

The files are being generated correctly I think:


donald at ubuntu:~/openmicroscopy/dist/lib/python$ grep IHPCServicePrx *.py
omero_API_ice.py:    ServiceFactory._op_createHPCService = IcePy.Operation('createHPCService', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, (), (), (), _M_omero.api._t_IHPCServicePrx, (_M_omero._t_ServerError,))
omero_api_IHPCService_ice.py:    _M_omero.api.IHPCServicePrx = Ice.createTempClass()
omero_api_IHPCService_ice.py:    class IHPCServicePrx(_M_omero.api.StatefulServiceInterfacePrx):
omero_api_IHPCService_ice.py:            return _M_omero.api.IHPCServicePrx.ice_checkedCast(proxy, '::omero::api::IHPCService', facetOrCtx, _ctx)
omero_api_IHPCService_ice.py:            return _M_omero.api.IHPCServicePrx.ice_uncheckedCast(proxy, facet)
omero_api_IHPCService_ice.py:    _M_omero.api._t_IHPCServicePrx = IcePy.defineProxy('::omero::api::IHPCService', IHPCServicePrx)
omero_api_IHPCService_ice.py:    _M_omero.api.IHPCServicePrx = IHPCServicePrx
omero_api_IHPCService_ice.py:    del IHPCServicePrx
omero_ServicesF_ice.py:    _M_omero.api._t_IHPCServicePrx = IcePy.declareProxy('::omero::api::IHPCService')




On 11 May 2012, at 13:03, Josh Moore wrote:

> 
> On May 11, 2012, at 1:23 PM, Donald MacDonald wrote:
> 
>> Hi,
>> 
>> I have created a new service in OMERO. I originally had the service as a pure blitz service, 
>> but I have had to push it down into the lower EJB services as I need the PixelService to have 
>> access to it.
>> 
>> I can access the service from Java, but when I try and call the service from Python I get the 
>> following error:
>> 
>>>>> import omero.clients
>>>>> a = omero.client('localhost')
>>>>> b = a.createSession('root','ome')
>>>>> c = b.createHPCService()
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File "/home/donald/openmicroscopy/dist/lib/python/omero_API_ice.py", line 283, in createHPCService
>>   return _M_omero.api.ServiceFactory._op_createHPCService.invoke(self, ((), _ctx))
>> RuntimeError: class ::omero::api::IHPCServicePrx is declared but not defined
>>>>> 
>> 
>> 
>> Any ideas as to what I have missed?
> 
> Hi Donald,
> 
> might you need to import the slice generated file?
> 
>  import IceImport
>  IceImport.load("module_HPCService_ice") # Or whatever name
> 
>> Regards
>> D.
> 
> Cheers,
> ~J.


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the ome-devel mailing list