Jersey Rest client not returns city name.
Rest Service
########
@Path("services/result");
public class Service {
@GET
@Produces("application/json")
@Path("city")
public City getCityName() {
return "New York";
}
Rest Client
#######
public class RestClient {
public static void main(
String[] args) {
ClientConfig clientConfig = new DefaultClientConfig();
clientConfig.getFeatures().put(JSONConfiguration.FEATUTRE_POJO_MAPPING, Boolean.TRUE);
Client client = Client.create(clientConfig);
WebResource webRes = client.resource("http://localhost:8080/rest/services/result/city");
ClientResponse response = webRes.accept("application/json").get(City.class);
String output = response.getEntity(City.class);
}
}