users@jersey.java.net

Re: [Jersey] Unmarshalled JSON not populating original class is was marshalled from.

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Tue, 05 Jan 2010 23:22:17 +0100

Please try:

Map<String, String> nsMap = new HashMap<String, String>();
nsMap.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
nsMap.put("http://musicbrainz.org/ns/mmd-2.0#", "mmd");
nsMap.put("http://musicbrainz.org/ns/ext#-2.0", "ext");

JSONConfiguration.mapped().rootUnwrapping(false).xml2JsonNs(nsMap).build();

If that does not work i will need a reproducible test case.
Please let me know how it works.

Thanks,

~Jakub



On Tue, Jan 05, 2010 at 09:09:52PM +0000, Paul Taylor wrote:
> Jakub Podlesak wrote:
> >Paul,
> >
> >Could you please also send *both* XML and JSON generated out of the beans,
> >i will then try to send you a working config back.
> >
> >Thanks,
> >
> >~Jakub
> Hi
>
> JSON:
> {"artist":{"type":"group","id":"4302e264-1cf0-4d1f-aca7-2a6f89e34b36","name":"Farming
> Incident","sort-name":"Farming
> Incident","gender":"male","country":"af","life-span":{"begin":"1999-04","end":""}}}
>
> XML:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?><artist
> type="group" id="4302e264-1cf0-4d1f-aca7-2a6f89e34b36"
> xmlns="http://musicbrainz.org/ns/mmd-2.0#"
> xmlns:ext="http://musicbrainz.org/ns/ext#-2.0"><name>Farming
> Incident</name><sort-name>Farming
> Incident</sort-name><gender>male</gender><country>af</country><life-span><begin>1999-04</begin><end></end></life-span></artist>
>
>
> thanks Paul
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>

-- 
http://blogs.sun.com/japod