Perfect! That's exactly what I was going for but couldn't quite express since the coffee hadn't hit yet :)<br><br>Awesome!<br><br><div class="gmail_quote">On Fri, Oct 29, 2010 at 12:13 PM, Pete Muir <span dir="ltr"><<a href="mailto:pmuir@bleepbleep.org.uk">pmuir@bleepbleep.org.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Very nice!<br>
<font color="#888888"><br>
--<br>
Pete Muir<br>
<a href="http://in.relation.to/Bloggers/Pete" target="_blank">http://in.relation.to/Bloggers/Pete</a><br>
</font><div><div></div><div class="h5"><br>
On 29 Oct 2010, at 17:14, Jozef Hartinger <<a href="mailto:jharting@redhat.com">jharting@redhat.com</a>> wrote:<br>
<br>
> Thanks Lincoln, great ideas! The RESTEasy Client Framework also allows reusing of JAX-RS annotated interfaces, so we can have an interface<br>
><br>
> @Path("/users")<br>
> public interface UserService<br>
> {<br>
> @GET<br>
> List<User> searchUsers(@QueryParam("search") String query,@QueryParam("start") int start, @QueryParam("limit") int limit);<br>
> }<br>
><br>
> which is implemented by the server. Then on the client, we can reuse it an simply do:<br>
><br>
> @Inject @RestService(url="<a href="http://example.com/users" target="_blank">http://example.com/users</a>")<br>
> private UserService users;<br>
><br>
> ...<br>
> List<User> jozefs = users.searchUsers("Jozef", 0, 20);<br>
><br>
> which gets translated to the following and sent to the server:<br>
> GET <a href="http://example.com/users?search=Jozef&start=0&show=20" target="_blank">http://example.com/users?search=Jozef&start=0&show=20</a><br>
> The response is unmarshalled automatically.<br>
><br>
> I've opened <a href="https://jira.jboss.org/browse/SEAMREST-5" target="_blank">https://jira.jboss.org/browse/SEAMREST-5</a> Feel free to add.<br>
><br>
> On 10/29/2010 03:43 PM, Lincoln Baxter, III wrote:<br>
>> Yes, exactly! Though I suppose if they are using RestEasy they will have<br>
>> this functionality by default, as you suggest. I wasn't thinking clearly<br>
>> when I wrote this, however. You are very correct. If RestEasy is already<br>
>> on the classpath, it should probably provide injection for web-service<br>
>> endpoints (via @Qualifer) annotations.<br>
>><br>
>> @Inject @RestEndpoint<br>
>> private Endpoint<DataService> endpoint;<br>
>><br>
>> The endpoint could then provide access to things like the HttpClient,<br>
>> the Request object, methods to invoke:<br>
>><br>
>> endpoint.sendRequest();<br>
>> endpoint.getResponse();<br>
>><br>
>> And would take care of the bootstrap / typing / (un)marshalling, etc...<br>
>><br>
>> Pretty much a super-quick way of specifying a web-service endpoint and<br>
>> invoking it via RestEasy Client Framework (under the covers of course)<br>
>> If there's an easier way, then this wouldn't be needed, but that's my<br>
>> thought!<br>
>><br>
>> --Lincoln<br>
>><br>
>> On Fri, Oct 29, 2010 at 4:09 AM, Jozef Hartinger <<a href="mailto:jharting@redhat.com">jharting@redhat.com</a><br>
>> <mailto:<a href="mailto:jharting@redhat.com">jharting@redhat.com</a>>> wrote:<br>
>><br>
>> Do you mean making a fork of the client framework in seam-rest or<br>
>> providing an integration with it (available when RESTEasy is on<br>
>> classpath)? I'll add it to the project ideas page.<br>
>><br>
>><br>
>> On 10/27/2010 04:06 PM, Lincoln Baxter, III wrote:<br>
>><br>
>> Excellent! I think that's a good call, and will help people adopt!<br>
>><br>
>> Have we considered moving the RestEast Client Framework into Seam<br>
>> RestEasy, or at least pulling it in if we are not already? That<br>
>> might be<br>
>> another sweet feature to help wet people's appetite.<br>
>><br>
>> Since we're no longer directly targeting RESTEasy, having a client<br>
>> consumer framework available to them would no longer be a<br>
>> "standard,"<br>
>> but it certainly would be nice.<br>
>><br>
>> I think we should consider this if not already done.<br>
>> --Lincoln<br>
>><br>
>> On Wed, Oct 27, 2010 at 6:29 AM, Pete Muir<br>
>> <<a href="mailto:pmuir@bleepbleep.org.uk">pmuir@bleepbleep.org.uk</a> <mailto:<a href="mailto:pmuir@bleepbleep.org.uk">pmuir@bleepbleep.org.uk</a>><br>
>> <mailto:<a href="mailto:pmuir@bleepbleep.org.uk">pmuir@bleepbleep.org.uk</a><br>
>> <mailto:<a href="mailto:pmuir@bleepbleep.org.uk">pmuir@bleepbleep.org.uk</a>>>> wrote:<br>
>><br>
>> Jozef has decided to target this module at the JAX-RS<br>
>> standard only,<br>
>> therefore the module name has changed slightly. We renamed<br>
>> the repo<br>
>> on github accordingly.<br>
>> _______________________________________________<br>
>> seam-dev mailing list<br>
>> <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a> <mailto:<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a>><br>
>> <mailto:<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a> <mailto:<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a>>><br>
>><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Lincoln Baxter, III<br>
>> <a href="http://ocpsoft.com" target="_blank">http://ocpsoft.com</a><br>
>> <a href="http://scrumshark.com" target="_blank">http://scrumshark.com</a><br>
>> "Keep it Simple"<br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> seam-dev mailing list<br>
>> <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a> <mailto:<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a>><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Lincoln Baxter, III<br>
>> <a href="http://ocpsoft.com" target="_blank">http://ocpsoft.com</a><br>
>> <a href="http://scrumshark.com" target="_blank">http://scrumshark.com</a><br>
>> "Keep it Simple"<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>"Keep it Simple"<br>