public class Person {
private String firstname;
private String lastname;
private PhoneNumber phone;
private PhoneNumber fax;
// ... constructors and methods
private void calculate()
{
}
}
I have serialized the Java object located on the server side and sent it to the client
XStream xstream = new XStream(new DomDriver());
Person joe = new Person("Joe", "Walnes");
joe.setPhone(new PhoneNumber(123, "1234-456"));
joe.setFax(new PhoneNumber(123, "9999-999"));
String xml = xstream.toXML(joe);
How can I deserialize that XML string into the Java object using JavaScript and execute the methods of person class in the client side using the JavaScript?
Please help me with syntax or any guidelines.