Tech Stack: Java 1.6, JAXB, Spring 3, JAX-RS (RESTEasy), XSD
Hello,
I am using Spring with JAX-RS to create a RestFul Webservice.
Everything works fine, except that the generated answers contain settings information, for example.
{ ... "setName": true, "setId": true, "setAddress": true, "setAge": true, }
I do not know what could be the reason for this? How to disable this?
Adi
UPDATE 1:
The PersonRequest class is generated by JAXB and contains all javax.xml.bind.annotation annotations. *.
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "personResponse " }) @XmlRootElement(name = "PersonResponse ") public class PersonResponse { @XmlElement(name = "Name", required = true) protected String name; @XmlElement(name = "Id", required = true) protected String id;
and the resource is as follows:
@Component @Path("/person") public class PersonImpl implements Person { @Override @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, "application/x-amf" }) @Path("v1") public PersonResponse getPerson() { .... .... } }
** UPDATE 2 ** This only happens when the Content-Type is json, in the case of a Content Type like "xml", setters are not returned. If it helps.