Hi,

I was able to send an array of integers by wrapping ints in a class. But the
response is like this

<intValues>
        <intValue>
                <number>134</number>
        </intValue>

        <intValue>
                <number>3504</number>
        </intValue>
</intValues>

But I want the array like this. How can I do this?

<intValues>
                <number>134</number>
                <number>3504</number>
</intValues>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

@Asset
public class IntArray {

    private List<IntValue> intList;

    public IntArray() {
        intList = new ArrayList<IntValue>();
    }

    @Produces(MediaType.APPLICATION_ATOM_XML)
    public List<IntValue> getIntList() {
        return intList;
    }

    @Consumes(MediaType.APPLICATION_ATOM_XML)
    public void setIntList(List<IntValue> intList) {
        this.intList = intList;
    }
}

+++++++++++++++++++++++++++++++++++++++++++++++++++++

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "intValueType")
@XmlRootElement(name = "intValue")
public class IntValue {

    @XmlElement
    private int number;

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }
}




--
View this message in context: 
http://apache-wink-users.3471013.n2.nabble.com/How-to-send-an-array-using-XML-tp7572727p7572730.html
Sent from the Apache Wink Users mailing list archive at Nabble.com.

Reply via email to