Hi Rob,
please see in line...
Rob - wrote:
> Hi,
>
> I'm integrating Jersey(server) with a WCF(client) and an issue when
> passing a Java HashMap<String,String> from the server to the client.
>
> Basically Jersey generates the following for a Map<String,String>
Jersey does not provide a writer for this out-of-the box, how did you
configure?
>
> {Map:{"entry",{"key":"key1","value":"value1"},"entry",{"key":"key2","value":"value2"},"entry",{"key":"key3","value":"value3"}.....}}
This is not a valid JSON, the Map is not quoted, then after the first
"entry", there should be a colon instead of the comma, etc.
>
> unfortunately, at the other side of the wire, WCF expects something
> more like:
>
> {Map:{"key":"key1","value":"value1"},{"key":"key2","value":"value2"},{"key":"key3","value":"value3"}.....}
Neither this is a valid JSON. Maybe you just need to write your own
message body writer for the Map<String, String> [1],
but then i would advise you not to use the the JSON media type for what
you generate out of it.
HTH,
~Jakub
[1]
https://jsr311.dev.java.net/nonav/releases/1.1/javax/ws/rs/ext/MessageBodyWriter.html
>
> I've already tried changing WCF to deserialize the Jersey generated
> response but to no avail (does not work and it's overly complicated).
>
> So, how can I customize the way JAXB spits Json so it can generate
> what WCF expects?
>
> Any pointers/ideas/snippets/etc are very much appreciated.
>
> Cheers
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
> Meet local singles online. Browse profiles for FREE!
> <http://clk.atdmt.com/NMN/go/150855801/direct/01/>