Hi John,

John Martin wrote:
I'm trying to integrate another system with ofBiz using a few RMI
calls.  Not being familiar with the ofBiz objects, I've gotten a
little stuck.

I'm calling the userLogin service and get back in the Map, a
[GenericEntity:UserLogin].  I cast the object back into a
GenericEntity and attempt to get various fields out but the system
bombs. Here's my code:

...
RemoteDispatcher rd.Naming.lookup(RMI_URL);
...
Map context = new HashMap();
context.put("login.username", username);
context.put("login.password", password);
Map result = rd.runSync("userLogin", context);
GenericEntity ge = (GenericEntity) result.get("userLogin");
// The object looks good in the debugger at this point, I can see the
key/value pairs


The above line should be:

GenericValue ge = (GenericValue) result.get("userLogin");

The GenericEntity class models the entity definitions, while the GenericValue class models the records in the entity.

Jacopo

String userId =  ge.getString("userLoginId");
// This is where I try and access a field but it blows up.

What is the proper way to access the values from the GenericEntity?

Thanks,

John

Reply via email to