--- On Fri, 6/6/08, Sergey Beryozkin <[EMAIL PROTECTED]> wrote:

>> Current JSON provider on the trunk works with a JAXBContext
> in tandem and it can only acquire a JAXBContext
> if XMLRootElement annotation is available. Once the patch
> I'm slowly working upon is commited, it will be able to
> acquire contexts 

Fantastic!

> Trying to provide your own message provider can be a
> reasonable solution. Runtime won't always be able to do
> the (de)serialzation 
> the way you expect (dur to a custom nature of a given type
> or due to the fact it's not capable of doing the given
> moment of time) 

This worries me a bit.  Our "standard" for remote interfaces is to use only 
primitive java data types (byte, short, long, String, float, double) along with 
arrays, possibly List and Map, and that's it.  A standard message provider 
ought to handle that right?  Trying to think of practices to avoid so we do not 
have to write custom message writers.

> and in such cases being able to provide your own provider
> is really handly

Yes...but that's a lot of work :)  A major benefit with a framework such as CXF 
is the automated data binding...:)
 
Thanks again!


> Cheers, Sergey
> 
> 
> >I got my CXF JAX-RS service going but the response is
> cryptic: No message body writer found for response class :
> AlertMsg.
> >
> > Browsing the archive, I found the solution, but it
> looks "roundabout".  I don't like the need to
> annotate my response bean with 
> > JAXB stuff.  An analogy is that Web Services (SOAP) do
> not require annotations/registration of writers of the
> response beans...why 
> > CXF/JAX-RS?  Thanks...
> >
> >    @GET
> >    @Path("/getAlertMsg/{aId}")
> >    @ProduceMime("application/json")
> >    public AlertMsg
> getAlertMsg(@PathParam("aId") String aId)
> >
> >
> > public class AlertMsg implements java.io.Serializable
> > {
> >   private String a;
> >   private String[] b;
> > }
> >
> >
> > 
> 
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road,
> Dublin 4, Ireland


      

Reply via email to