Pass complex object into RESTful service
Suppose, I have Employee.java class. public class Employee { private String firstName; private String lastName; private String city; // getter // setter // override toString() to print the variables } I want to set values to Employee class through REST service: @POST @Path("/saveemployee") @Consumes(MediaType.APPLICATION_JSON) public Response saveEmployee(Employee employee){ Response response = null; System.out.println(employee.toString()); // further procees to store into db return response; } Now, I want to call this rest service inside my java class: import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.httpclient.method...