I'd like to create a simple project to have a connection between this project and a web service I created in Jersey.
My web service have the following service :
http://localhost:8080/esinister/test/findtest?testnumber=12345.
The definition of this service is :
@GET
@Path("findtest")
@Produces(MediaType.APPLICATION_XML)
public Customer findTest(@DefaultValue("") @QueryParam("testnumber") String clientNumber)
I'd like to create an application to have the Customer number 12345 (String).
How I can create this ?
I started my application on this way ...
public static void main(String[] args) {
// TODO Auto-generated method stub
Client client = ClientBuilder.newClient();
WebTarget target = client.target("http://localhost:8080/esinister/test/findtest?testnumber=12345");
javax.ws.rs.core.Response rs = target.request(MediaType.TEXT_PLAIN).get();
System.out.println(rs.toString());
}
But I think I forgot something ...
My error is :
InboundJaxrsResponse{ClientResponse{method=GET, uri= http://localhost:8080/esinister/test/findtest?testnumber=12345, status=406, reason=Inacceptable}}
Have you got an idea ?