• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Restful web services in Java  RSS feed

Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am invoking Restful web service in Java. The message body is simple xml


and the server side, i have POJO class for this.

public class Account {
private String name;
private String accNo;
public String getName() {
return name;
public void setName(String name) {
this.name = name;
public String getAge() {
return accNo;
public void setAge(String age) {
this.accNo = age;

What i want to know is how to map payload(xml) and pojo in Resource class's method (Restful).


public AccountDetails postAccountXML(Account account)
return ...
This is not working, please tell me how can resolve in Restful. the mapping between soap message body(payload) and Account class mapping is working
Posts: 42974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's where JAXB comes into play. See http://www.vogella.com/articles/REST/article.html or search for "jaxb jersey java" for others tutorials.
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
ScroogeXHTML 8.2 - easy to use RTF to HTML converter library
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!