there are two steps
just create interface class and map logical url to resource class
@Path(EmployeeResource.EMP_URL)
interface EmployeeClient{
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("all")
public ClientResponse<Employee> getEmployeeDetails();
}
@Path( EmployeeResource.EMP_URL)
class EmployeeResource{
public static final
String EMP_URL = "/service/employee";
@Autowired
EmployeeService. employeeService.;
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("all")
public Employee getEmployeeDetails(){
return employeeService.getEmployee();
}
finally initialize client in resteasy.xml
now you can use client directly in jsf handler class