cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kannan Ramasamy <ramkannan2...@gmail.com>
Subject Re: Support for Json arrays
Date Mon, 14 Feb 2011 17:10:45 GMT

Hi

@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
@XmlRootElement(name = "store")
public class Store {
    private String description;    
    private Set<Image> images;
    private Set<Keyword> keywords;

    @XmlElement(name = "keyword")
    @XmlElementWrapper(name = "keywords")
    public Set<Keyword> getKeywords() {
        return this.keywords;

    }

    @XmlElement(name = "image")
    @XmlElementWrapper(name = "images")
    public Set<Image> getImages() {
        return images;
    }


}  


JSON INPUT
========
{
    "ns1.store": {
        "ns1.description": "links offers a variety of office",
        "ns1.images": {
            "ns1.image": [
                {
                    "ns2.imageUri": "http:localhost:\10352.jpg",
                    "ns2.height": 342,
                    "ns2.type": "thumbnail",
                    "ns2.width": 380 
                },
                {
                    "ns2.imageUri": "http:localhost:\10352.jpg",
                    "ns2.height": 40,
                    "ns2.type": "logoLarge",
                    "ns2.width": 150 
                } 
            ] 
        },
        "ns1.keywords": {
            "ns1.keyword": {
                "ns1.value": "34inks" 
            },
            "ns1.keyword": {
                "ns1.value": "35inks" 
            } 
        } 
    }
}


If i try to pass the above mentioned json data. I am getting as empty array
after unmarshalling. 



-- 
View this message in context: http://cxf.547215.n5.nabble.com/Support-for-Json-arrays-tp576369p3384766.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Mime
View raw message