I think, better approach would be using BlazeDS or Hessian.