facebook

Get structred XML Response in Webservice

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #306248 Reply

    thilsen
    Member

    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

Viewing 1 post (of 1 total)
Reply To: Get structred XML Response in Webservice

You must be logged in to post in the forum log in