SeamFramework.orgCommunity Documentation

Chapter 5. RESTEasy Client Framework Integration

5.1. Using RESTEasy Client Framework with Seam REST
5.2. Manual ClientRequest API
5.3. ClientExecutor configuration

The RESTEasy Client Framework is a framework for writing clients for REST-based web services. It reuses JAX-RS metadata for creating HTTP requests. For more information about the framework, refer to the project documentation .

Integration with the RESTEasy Client Framework is optional in Seam REST and only available when RESTEasy is available on classpath.

Let's have the TaskService sample interface. A remote server implements this interface exposing a web service for getting task details.


To access the remote web service, let Seam REST build and inject a client object of the web service.


What really happens is that the Seam REST module injects a proxied TaskService interface. Under the hood, the RESTEasy Client Framework converts every method invocation on the TaskService to an HTTP request and sends it over the wire to http://example.com. The HTTP response is unmarshalled automatically and the response object is returned by the method call.

In addition, it is possible to use EL expressions within the URI.

@Inject @RestClient("#{example.service.uri}")

Besides proxying JAX-RS interfaces, the RESTEasy Client Framework provides the ClientRequest API for building the HTTP requests manually. For more information on the ClientRequest API, refer to the project documentation


If not specified otherwise, every request is executed by a default Apache HTTP Client 4 configuration. This can be altered by providing a ClientExecutor bean.