Java Reference
In-Depth Information
We then simply need to select the RESTful web service we developed earlier.
At this point, NetBeans generates the following code:
package com.ensode.glassfishbook.jaxrsclient;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.UniformInterfaceException;
import com.sun.jersey.api.client.WebResource;
/** Jersey REST client generated for REST resource:CustomerFacadeREST
[com.ensode.netbeansbook.jaxrs.customer]<br>
* USAGE:<pre>
* NewJerseyClient client = new NewJerseyClient();
* Object response = client.XXX(...);
* // do whatever with response
* client.close();
* </pre>
* @author heffel
*/
public class NewJerseyClient {
private WebResource webResource;
private Client client;
private static final String BASE_URI =
"http://localhost:8080/jaxrs/resources";
public NewJerseyClient() {
com.sun.jersey.api.client.config.ClientConfig config = new
com.sun.jersey.api.client.config.DefaultClientConfig();
 
Search WWH ::




Custom Search