users@jersey.java.net

Re: [Jersey] Re: JAXBContextResolver not being used

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 31 May 2010 11:14:27 +0200

On May 28, 2010, at 10:06 PM, vineetkr211 wrote:

>
> Thanks for your reply.
>
> I have one more question. Is it possible to send plain json string
> to my
> rest web service and read it as jaxb type on the server. Actually my
> client
> is a javascript based thats why I am asking this.
>

Yes, as long as the "on-the-wire" format is JSON and of the
appropriate form.


> Also my jaxb types are schema aware, so I will have to send my json
> string
> in BadgerFish format or I can use other Builders as well?
>

You need to ensure the client is in sync with the convention defined
on the server side.

This is one of the issues with the JAXB/JSON integration as it is
often harder to know what the required structure of the JSON should be
than say using Jackson, which has a more direct mapping between Java
objects and the JSON serialization.

Paul.