I am new to XMLRPC and I am working a XMLRPC Servlet hosted on Jetty.
Right now I am having some problems serializing simple objects using the build in IntropectingSerializer.
I have a simple class:
public Person
{
String name;
String address;
int age;
List<String> parents;
//constructor
public Person(String name, String, address, int age, List<String> parents);
List<String> parents = new ArrayList<String>()
parents.add("mary");
parents.add("jackson");
Person test = new Person("alvin", "24 lorong", 15, parents);
XmlRpcStruct rs = (XmlRpcStruct)client.invoke("server.sendPerson", new Object {test});
when invoking the rpc method, I get the following errors:
Could not serialize property:
at redstone.xmlrpc.serializers.IntrospectingSerializer.serialize
at redstone.xmlrpc.XmlRpcSerializer.serialize
at redstone.xmlrpc.XmlRpcClient.invoke
at Main.main(Main.java 53)
Correct me if I am wrong, shouldn't the introspectiveSerializer serialize the class into a xmlrpcStruct using the getter methods defined in the class. However I am getting errors with the serialize property. Any advice is greatly appreciated!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could it be that your accessors (getters) are not public? I'll do a quick experiment myself here, but perhaps you could check on your end too by making them public so that they show up during introspection.
BR,
Greger.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am new to XMLRPC and I am working a XMLRPC Servlet hosted on Jetty.
Right now I am having some problems serializing simple objects using the build in IntropectingSerializer.
I have a simple class:
public Person
{
String name;
String address;
int age;
List<String> parents;
//constructor
public Person(String name, String, address, int age, List<String> parents);
//getter methods
String getName(){return this.name;}
String getAddress(){return this.address;}
String getAge(){return this.age;}
List<String> getParents(){return parents;}
}
in the client I have:
List<String> parents = new ArrayList<String>()
parents.add("mary");
parents.add("jackson");
Person test = new Person("alvin", "24 lorong", 15, parents);
XmlRpcStruct rs = (XmlRpcStruct)client.invoke("server.sendPerson", new Object {test});
when invoking the rpc method, I get the following errors:
Could not serialize property:
at redstone.xmlrpc.serializers.IntrospectingSerializer.serialize
at redstone.xmlrpc.XmlRpcSerializer.serialize
at redstone.xmlrpc.XmlRpcClient.invoke
at Main.main(Main.java 53)
Correct me if I am wrong, shouldn't the introspectiveSerializer serialize the class into a xmlrpcStruct using the getter methods defined in the class. However I am getting errors with the serialize property. Any advice is greatly appreciated!
Could it be that your accessors (getters) are not public? I'll do a quick experiment myself here, but perhaps you could check on your end too by making them public so that they show up during introspection.
BR,
Greger.