From: Bill B. <bb...@re...> - 2012-01-24 14:42:23
|
We have a complex response object mapping on the client side, but the developer that added the functionality never documented it AFAICT. Here's an example: https://github.com/resteasy/Resteasy/blob/Branch_2_3/resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/finegrain/client/ResponseObjectTest.java I'm not sure it works on the server side though. On 1/24/12 5:58 AM, Thomas Vestergaard wrote: > Hi Clovis, > > Can you (or someone else) enlighten me to the correct usage of the annotation? > Is it simply not supported in the client framework? Or are there some restrictions as to how it should be used, which are not described in the reference manual? > > Regarding your suggestions: > 1) Rather than writing a new set if MessageBodyWriter and -Reader, wouldn't it be sufficient to write and register a suitable interceptor? > 2) Good point. This will probably be our backup plan. > > Thanks for your response. The input is most appreciated. > /Thomas > > > -----Oprindelig meddelelse----- > Fra: Clo...@ra... [mailto:Clo...@ra...] > Sendt: 24. januar 2012 11:33 > Til: Thomas Vestergaard > Emne: Antwort: Re: [Resteasy-developers] Mapping header field in response to object property > > Yes, you are misusing the annotation... > > I have two suggestions (which I've already used, and they worked): > 1) Write and register your own MessageBodyWriter AND MessageBodyReader, > which must be able to write/read the header fields in addition to > writing/reading the XML entity (You can extend one of the RestEASY > Providers, like JAXBXmlRootElementProvider to spare some work). > 2) Change the signature of your method to Response getImageById(...); > then, on the client side, use ClientResponse r = > (ClientResponse)proxy.getImageById(...); Now you can get the entity with > r.getEntity(ImageDTO.class) and the value of ETag with > r.getMetadata().get("ETag") > > Hope it helps > > -- clovis > > > > ______________________________________ > Raiffeisen Bausparkasse Gesellschaft m.b.H., 1050 Wien, Wiedner Hauptstraße 94, Firmenbuchnummer 116309v, Handelsgericht Wien, DVR 0066257, UID ATU15350206 > > Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten. Wenn diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns unverzueglich zu informieren und sie zu loeschen. > > This e-mail message may contain information, which is confidential and protected. If you are not the intended recipient of this message, we ask you to inform us immediately and delete the message afterwards. > > > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |