Hi all,
I am using jersey webservices. (REST based calls).
i am getting xml response by using
@Produces(MediaType.APPLICATION_XML).
Here i have a class called BaseData (which annotated by @XmlRootElement)
and subresource class called MyMetaData(which annotated by @XmlRootElement)
here i am getting xml as (subresource with 2 address)
<BaseData>
<description>Desc1</description>
<MyMetaData>
<address>aaaaaaaaaa</address>
<address>bbbbbbbbbb</address>
<zipcode>111111</zipcode>
<zipcode>222222</zipcode>
<city>Chennai</city>
<city>Trichy</city>
</MyMetaData>
<name>Thilsen</name>
<age>28</age>
<title>Mr</title>
</BaseData>
But i need to get it as
<BaseData>
<description>Desc1</description>
<MyMetaData>
<MetaData>
<address>aaaaaaaaaa</address>
<zipcode>111111</zipcode>
<city>Chennai</city>
</MetaData>
<MetaData>
<address>bbbbbbbbbb</address>
<zipcode>222222</zipcode>
<city>Trichy</city>
</MetaData>
</MyMetaData>
<name>Thilsen</name>
<age>28</age>
<title>Mr</title>
</BaseData>
How can i achieve this?
Pls suggest me!
Thanks & Regards,
Thilsen