Friday, 15 March 2013

json - jersey/jaxb unmarshalling a java object, but fields not populated -



json - jersey/jaxb unmarshalling a java object, but fields not populated -

i have bailiwick of jersey server side code takes java object body parameter. java object lets preferences defined below.

@xmlrootelement(name = "preferences", namespace = "http://arjun.test.com/tests/1.0") public class preferences { string field1; string field2; public preferences() { } @xmlelement(name = "field-1", namespace = "http://arjun.test.com/tests/1.0") public string getfield1() { homecoming field1; } public void setfield1(string field1) { this.field1 = field1; } @xmlelement public string getfield2() { homecoming field2; } public void setfield2(string field2) { this.field2 = field2; } }

my problem is: while sending info client populating both fields, somehow in server first field value null, if alter field1 xml annotation same field2, works fine.

can please allow me know error doing.

the bailiwick of jersey server method producing , consuming json objects.

java json jaxb jersey

No comments:

Post a Comment