You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Joe <fi...@yahoo.de> on 2007/10/11 13:46:45 UTC
passing user defined datatypes
Hi,
To have an easy readable code i have written a method
which do the casting to my shared client/server interface.
public <T> T getInstance(Class<T> clazz) {
return (T) factory.newInstance(clazz);
}
where factory is an instance of
org.apache.xmlrpc.client.util.ClientFactory
So code on the client side looks quite well:
IServerInfo server = getInstance(IServerInfo.class);
String version = server.getVersion();
The next i need is a way to easy pass my own parameter
types via xmlrpc.
Currently i have a POJO like that
public class Person
{
String name;
String city;
...
}
Currently i do the following to transfer the data of this
POJO to the server:
IGroup group = getInstance(IGroup.class);
group.add(person.getName(), person.getCity(),...);
But i want to do it in this way:
IGroup group = getInstance(IGroup.class);
group.add(person);
What i have to do to pass my own parameter types via xmlrpc calls?
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org