Handling Java POJO with named parameters

73 views
Skip to first unread message

Karteek Chenna

unread,
Jun 29, 2012, 2:51:20 PM6/29/12
to json...@googlegroups.com
I have a requirement where I need to create a service where my parameters are java POJO/DTO objects.
How to I represent my POJO as in JSONRPC format and use with jsonrpc4j.?

Example:
public User implements Serializable{

    private static final long serialVersionUID = 1L;
    private String userName;
    private Strin pswd;

    /* And Getter Setter Methods & toString() Methods in my DTO*/
}

Service Interface
---------------------
public UserService {
  public String processUserRecord(@JsonRpcParam("userRecord") User userRecord);
}


How do I represent this Object in JSON RPC format and also use JSPN RPC to invoke my JSON Service

Is this correct format of JSON_RPC for above User Object
 {"jsonrpc": "2.0", "method": "processUserRecord", "params":{"userRecord":{"userName":"testUser","pswd","testPswd"}}, "id": 1}



Reply all
Reply to author
Forward
0 new messages