SeamFramework.orgCommunity Documentation

Chapter 39. RESTEasy Client Framework Integration

39.1. Using RESTEasy Client Framework with Seam REST
39.2. Manual ClientRequest API
39.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 us assume as an example that a remote server exposes a web service for providing task details to the client through the TaskService interface below.


To access the remote web service, Seam REST builds and injects a client object of the web service.


The Seam REST module injects a proxied TaskService interface and 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.

URI definition supports EL expressions.

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

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


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