Hi all,

I developed a REST web service using CXF's http binding, and I have no
problem at all with the object  marshaling or the reading of the XML
outputs. I now need to get JSON output from the same web service, so I
configured a new ws endpoint in spring, which will return the JSON in the
"mapped" format.

However, I started to notice odd JSON files being produced, and wrong XML
object conversion. I'll give this example, in which I need a List of labels
and a List of value objects (and who contain a list themselves) to be
returned.

http://www.nabble.com/file/p16538281/xml.xml xml.xml 
http://www.nabble.com/file/p16538281/json.json json.json 

The JSON output, as you can see, is strangely groupin values objects, two by
two, without any particular reason. These are the objects which originate
such a result:

The response:
@XmlAccessorType(XmlAccessType.FIELD)
public class QueryByIdResponse extends GenericResponse {
        
        @XmlElementWrapper(name="labels")
        private List<String> label;
        
        private List<WorkOrderGenericValues> values;


WorkOrderGenericValues:
@XmlAccessorType(XmlAccessType.FIELD)
public class WorkOrderGenericValues {
        @XmlElement(name="value")
        private List<String> stringList;


Is this a Jettison bug or am I missing something??
Any tip would be greatly appreciated!! 

Thanks
Rui Ramos
-- 
View this message in context: 
http://www.nabble.com/Problems-using-Jettison-for-JSON-mapped-parsing-tp16538281p16538281.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to