• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Response xml in Apache CXF using JAX-RS

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using JAX-RS (Restful Service) in Apache CXF to create my application. Xml is going back in Response. So, it is as below :

<Customer>
<id>123</id>
<name>abc</abc>
<phone>123</phone>
</Customer>

So, for this response i have created bean class :

@XmlRootElement(name = "Customer")
public class Customer {
}

I want to customize above xml. So, how i can do that ? It is like as :

<Customer id="123">
<name>abc</name>
<phone>123<phone>
</Cusomer>

In short, i want I want to add attribute. So, how i can do that ?

Pls help me..
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic