This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Returning HashMap from Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Returning HashMap from Web Service" Watch "Returning HashMap from Web Service" New topic
Author

Returning HashMap from Web Service

Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
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

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!
 
jQuery in Action, 2nd edition
 
subject: Returning HashMap from Web Service
 
Similar Threads
Can an array be used as a HashMap Key?
How to cast an Object to a HashMap with out getting unchecked cast warning
WA #1.....word association
switch on String
retrive Vector from HashMap