It worked! :-) So now I'm just returning:
return Response.ok(simpleResponse).build(); where the SimpleResponse class has the @XmlRootElement annotation on top. Thank you very much for your help, V. On Fri, Apr 4, 2008 at 5:51 PM, Beryozkin, Sergey <[EMAIL PROTECTED]> wrote: > Hi > > MessageBodyWriter.isWriteable() checks if a given type can be > serialized, so if say you custom type has no JAXB annotations then no > matching writer will be found. You may want just to add @XmlRootElement > to the root of your class, alternatively you can register your custom > writer. Please check the JAXRS system tests on how this can be > done...(I'm sorry, at the moment that's our documentation :-)). > > Typically You don't need to extend a Response, Response is a convenience > holder for a status, the entity and response headers > > Cheers, Sergey > > -----Original Message----- > From: Vincenzo Vitale [mailto:[EMAIL PROTECTED] > Sent: 04 April 2008 16:28 > To: [email protected] > Subject: Re: Problem with JAX-RS services in the last CXF snapshot. > > Looking at the CXF code it seems the problem is here: > > private <T> MessageBodyWriter<T> chooseMessageWriter( > List<MessageBodyWriter> writers, Class<T> type, MediaType > mediaType) > { > for (MessageBodyWriter<T> ep : writers) { > if (!ep.isWriteable(type)) { > continue; > } > > where [EMAIL PROTECTED], > [EMAIL PROTECTED], > [EMAIL PROTECTED], > [EMAIL PROTECTED], > [EMAIL PROTECTED], > [EMAIL PROTECTED], > [EMAIL PROTECTED] > > these are the writers and my class seems not be "registered with this > writers. Maybe there is a way to make it possible for a writer to have > my > class in output... but I'm just guessing... :-) > > I will try your solution.. > > > Thnaks, > V. > > On Fri, Apr 4, 2008 at 4:51 PM, Sergey Beryozkin > <[EMAIL PROTECTED]> > wrote: > > > Hi > > > > I think you need to return a Response and then in your code do : > > > > return Response.setEntity(yourObject).build() > > > > I think that just by the virtue of extending a Response you can not > have > > it serialized. > > > > > > > - Before the JAXRS implementation I always used to put the > annotations > > at > > > the interface level but now in this way it doesn't seem to work > anymore. > > I'm > > > missing something to make it possible? Maybe is this a JAXRS > > specification? > > > > I've seen on a Jersey list recently that it's a feature of the 0.7 API > > (spec), we're at a 0.6 level currently... > > and that annotations will only be supported at a method level, don't > know > > more about it at this stage > > > > Hope it helps, Sergey > > > > > > > > > Hi, > > > > > > I'm trying to integrate the JAX-RS implementation now included in > CXF > > 2.1 > > > (snapshot). > > > > > > The service is correctly called and the parameters arrive fine but > then > > I > > > get a page with the message: > > > > > > No message body writer found for response class : SimpleResponse. > > > > > > Where SimpleResponse is my custom response bean extending the > > > javax.ws.rs.core.Response. > > > > > > Here the code: > > > > > > @Path("/ButtonService") > > > public class ButtonWebServiceImpl implements ButtonWebService { > > > > > > > > > > > > @Path("/addressButton/{action}/{apiKey}/{countryCode}/{state}/{city}/" > > > + > > > > > > "{street}/{number}/{postCode}/{attribution}/{logoUrl}/{name}/{descriptio > n}/{source}/{buttonServer}/{buttonArtUrl}") > > > @GET > > > public SimpleResponse createForAddress(@PathParam(value = > "action") > > > String action, @PathParam(value = "apiKey") > > > String apiKey, @PathParam(value = "countryCode") > > > String countryCode, @PathParam(value = "state") > > > String state, @PathParam(value = "city") > > > String city, @PathParam(value = "street") > > > String street, @PathParam(value = "number") > > > String number, @PathParam(value = "postCode") > > > String postCode, @PathParam(value = "attribution") > > > String attribution, @PathParam(value = "logoUrl") > > > String logoUrl, @PathParam(value = "name") > > > String name, @PathParam(value = "description") > > > String description, @PathParam(value = "source") > > > String source, @PathParam(value = "buttonServer") > > > String buttonServer, @PathParam(value = "buttonArtUrl") > > > String buttonArtUrl) { > > > ... > > > } > > > } > > > > > > and in Spring: > > > > > > <jaxrs:server id="buttonWebServiceRest" > > > address="/rest/"> > > > <jaxrs:serviceBeans> > > > <ref bean="buttonWebServiceImpl" /> > > > </jaxrs:serviceBeans> > > > </jaxrs:server> > > > > > > > > > Have any glue on that? > > > > > > > > > Further questions: > > > > > > - My SimpleResponse extend the javax Response as I red in the JAXRS > new > > > documentation that this is a requirement for the HTTPMerthod > annotation. > > Is > > > this valid also for the @GET annotation? How I have to implement it? > > > > > > - Before the JAXRS implementation I always used to put the > annotations > > at > > > the interface level but now in this way it doesn't seem to work > anymore. > > I'm > > > missing something to make it possible? Maybe is this a JAXRS > > specification? > > > > > > > > > > > > > > > Thanks in advance, > > > Vicio. > > > > > > > ---------------------------- > > IONA Technologies PLC (registered in Ireland) > > Registered Number: 171387 > > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, > Ireland > > > > ---------------------------- > IONA Technologies PLC (registered in Ireland) > Registered Number: 171387 > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland >
