java - How do I marshal a hashmap to xml? -


i'm trying marshall hashmap xml can see result on rest client. i'm using prettyxml marshalling hashmap. when run code, saxexception2 saying "unable marshal type "java.util.hashmap" element because missing @xmlrootelement annotation". not know how , use annotation in code. can please help?

or there other way see contents of hashmap on rest client?

@path("/abc") public class problem {  @post @path("/result::{id}") @produces("application/xml") public string methodone(@pathparam("id") uuid i) { . . .  map<string, device> info = new hashmap<string, device>(); info = xyz.perform(con, coll);  string result = prettyxml.prettyformat(info); return result;   } }     


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -