What is the error you are seeing ? Do you use Jackson or the default provider ?

Sergey

On 28/06/12 12:22, ramesh wrote:
I am unable to pass JSON data as POST.
{ "Member":{"id":"3" , "city":"Tokyo", "country":"Japan" }}
Is this the right format.


this is my interface:

@Path("/for")
public interface ReqService {

/**
* Adds an invite requested by the guest.
*/
@POST
@Path("/invite")
@Consumes("application/json")
public void addMember(Member mem);

}

and this is my implementation:

@Override
public void addMember(Member mem){
String rkey =mem.getId();
String col1 = mem.getCity();
String col2 = mem.getCountry();
myDAO.insertMulti(rkey, col1, col2);
}

@XmlRootElement(name = "Member")
@XmlType( propOrder = {"id", "city", "country" })
public class Member {
private String id;
private String city;
private String country;

getters & setters ..

regards,
Ramesh


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to