[ome-users] NegativeSizeException using getUserDetails
Mario Valle
mvalle at cscs.ch
Tue Dec 16 15:13:10 GMT 2008
I'm expanding the simple client to try to learn OmeroCpp.
The example below works (and obviously returns no result) if you comment the line marked //1
Otherwise it crashes in the getUserDetails() call with:
terminate called after throwing an instance of 'Ice::NegativeSizeException'
what(): /Users/mvalle/Ice-3.3.0/cpp/include/Ice/BasicStream.h:360:
Ice::NegativeSizeException:
protocol error: negative size for sequence, dictionary, etc.
The code is translated (hopefully correctly) from the shoola OMEROGateway.java file around
line 1015.
Anyway, is anyone around that have any OmeroCpp client code to share?
Thanks!
mario
#include <omero/client.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
//
// Connect to OMERO
//
cout << "--- Connect ---" << endl;
omero::client omero(argc, argv);
omero::api::ServiceFactoryPrx sf = omero.createSession();
sf->closeOnDestroy();
//
// Try the Pojos services
//
cout << "--- Pojos ---" << endl;
omero::api::IPojosPrx pojo = omero.getSession()->getPojosService();
omero::api::StringSet list;
list.push_back("mvalle"); //1
omero::sys::ParamMap options;
omero::api::UserMap m;
m = pojo->getUserDetails(list, options);
//
// Look at the results
//
cout << "--- getUserDetails ---" << endl;
cout << m.size() << endl;
omero::api::UserMap::const_iterator im;
for(im=m.begin(); im != m.end(); ++im) cout << im->first << endl;
//
// Check the IAdmin interface
//
cout << "--- Admin ---" << endl;
// IAdmin is responsible for all user/group creation, password changing, etc.
omero::api::IAdminPrx admin = omero.getSession()->getAdminService();
// Who you are logged in as.
cout << admin->getEventContext()->userName << endl;
return 0;
}
~
--
Ing. Mario Valle
Data Analysis Group | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
More information about the ome-users
mailing list