Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Returning HashMap from Web Service

 
Anjali S Sharma
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it correct to say that a Java webservice cannot return a HashMap although it can return a List. If this is true can someone please let me know the reason.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
You can do some voodoo with JAXB, called XmlAdapters, to be able to return a map. Check this link:
http://weblogs.java.net/blog/kohsuke/archive/2005/04/xmladapter_in_j.html
Best wishes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic