I need to create rest-easy client, using de interface of the RestService created by others...
That's work good, except by just one thing...
When i update from rest-easy 2.3.5.Final to rest-easy 3.0.x, the ClientRequestFactory class appear like @Deprecated.
The actual code is:
ClientRequestFactory crf = new ClientRequestFactory(UriBuilder.fromUri("http://url-of-service").build());
SomeRestInterface client = crf.createProxy(SomeRestInterface.class);
client.theMethod();
Any one, now what is the alternative of rest-easy for ClientRequestFactory at version 3.0.x?
Resteasy Client-API has been marked deprecated as JAX-RS standardized a Client-API.
You can find information about the Resteasy-integration of the new Client-API in the documentation.
Your example could look like (untested):
Client client = ClientBuilder.newClient();
Response response = client.target("http://url-of-service").request().get();
// read and close the response
Or if you want to use Resteasy Proxy Framework:
Client client = ClientFactory.newClient();
ResteasyWebTarget target = (ResteasyWebTarget) client.target("http://url-of-service");
SomeRestInterface client = target.proxy(SomeRestInterface.class);
client.theMethod();