|
From: Bill B. <bb...@re...> - 2008-06-06 12:47:52
|
Thanks Christian. Feedback is my most desired comodity! Christian Sadilek wrote: > Ok, tested both and it works just great! I think this should be useful > to a lot of people. The next weeks I'll do some more work using RESTeasy > and will provide further feedback. > > Thanks, > Christian > > 2008/6/5 Bill Burke <bb...@re... <mailto:bb...@re...>>: > > Ok, I committed something. You can either put a resteasy > ClientResponse<yourType> as the response, or Response.Status. The > latter is just access to the status code. Its in SVN trunk if you > want to testdrive, otherwise, I'll just do another release next week > sometime. > > Here's some links to code and examples: > > http://resteasy.svn.sourceforge.net/svnroot/resteasy/trunk/jaxrs/resteasy-jaxrs/src/main/java/org/resteasy/spi/ClientResponse.java > > http://resteasy.svn.sourceforge.net/svnroot/resteasy/trunk/jaxrs/resteasy-jaxrs/src/test/java/org/resteasy/test/finegrain/client/ClientResponseTest.java > > > Christian, I'd be very interested in further ideas you have for > improving things on the Client framework. > > > Bill Burke wrote: > > I think I'm going to have to define my own Response > interface/class. The problem with Response is that it has no > type information within it so I have no idea how to unmarshal > the returned entity/messagebody. Plus all the set() methods it > has doesn't make sense, it should be immutable. > > I'm thinking: > > package org.resteasy; > > public interface ClientResponse<T> > { > <T> T getEntity(); > MultivaluedMap<String, String> getHeaders(); > int getStatus(); > } > > I'll fool around with something today and get back to you. > > Bill > > Christian Sadilek wrote: > > 1. is the way I originally hoped it would work. To have the > response object available on the client would be beautiful. > It would offer easy access to the status and entity. > > thanks, > Christian > > 2008/6/5 Bill Burke <bb...@re... > <mailto:bb...@re...> <mailto:bb...@re... > <mailto:bb...@re...>>>: > > I haven't put a lot of thought into this. I guess have > two things: > > 1. Allow return of a Response object in the client framework. > 2. An method annotation that says that the return value > is a status > code @StatusCode or something > 3. Allow returning a Response.Status enum > 4. Throw a WebApplicationExceptoin iif, the response > falls into an > error code bucket. > > Thoughts? > > > > > > Christian Sadilek wrote: > > The HttpClientInvoker throws a RuntimeException when > a status > other then SC_OK is returned by the executed method. > What if the > method returns Response.created(uri).build()? Why > should the > HttpClientInvoker throw an exception in case of > SC_CREATED (201)? > > In general how do I check if the request went well? > Is there a > way to retrieve the http status code on the client? > > Thanks, > Christian > > > > > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > <mailto:Res...@li...> > <mailto:Res...@li... > <mailto:Res...@li...>> > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > -- Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > > > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |