Questions tagged [jersey-client]

The Jersey client API is a high-level Java based API for interoperating with RESTful Web services.

The Jersey client API is a high-level Java based API for interoperating with RESTful Web services. It makes it very easy to interoperate with RESTful Web services and enables a developer to concisely and efficiently implement a reusable client-side solution that leverages existing and well established client-side HTTP implementations.

More Details

820 questions
0
votes
1 answer

Deserialize List with Jackson in JUnit (Jersey Client)

I recently moved from Jersey 1.X to Jersey 2.1 and using jersey-media-json-jackson for (de-)serializing to Json. In my JUnit-Test I would like to consume a web service that return a List. With Jerey 1.x I used to work with GenericType. However,…
Johannes Staehlin
  • 3,680
  • 7
  • 36
  • 50
0
votes
1 answer

How to mock builder.type().post() method in Jersey REST service

I need to mock builder.type(...).post(...) inorder to write test case for rest client. But I'am getting null pointer exception when mocking it. method to be mocked: ClientResponse response =…
rohan lukose
  • 101
  • 1
  • 13
0
votes
1 answer

Jersey WS issue with Jetty/Tomcat: SEVERE Warnings

I'm a little stuck on an issue we're having deploying a web service. I have tried seemingly everything (although obviously that's not true). These are my jersey dependencies: com.sun.jersey
Eamonn
  • 597
  • 7
  • 23
0
votes
1 answer

Getting Error using Jersey client

I am using a jersey client to push data to the localhost. Here is my code - public CloudConnection(JSONObject jsonPush) throws ClientProtocolException, IOException, JSONException { ClientConfig config = new DefaultClientConfig(); Client…
Dan
  • 801
  • 2
  • 14
  • 29
0
votes
1 answer

How to read data in response of POST operation using jersey client (RestFull)

In my java client application, I am accessing a endpoint URL and could able to get response back, but it is in HTML code!. Method : Post resource.accept(MediaType.APPLICATION_JSON_TYPE); WebResource resource = Client.create().resource( …
Kodaganti
  • 209
  • 1
  • 8
  • 20
0
votes
1 answer

Passing a Database query as an argument from jersey client to jersey webservice to perfom DML

I have a jersey client which needs to perform DML operation on a remote database server. I have created jersey web service which takes argument as a string(i.e. query to be passed by client). I don't know how should I do it. Please help me. Thanks…
Samir
  • 55
  • 6
0
votes
1 answer

How to leverage object transformation in Jersey?

I have annotated my POJOs in Jersey and I have test methods like this one: @POST @Path("/test/pojo/transformation") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_XML) public MyPojo…
pulkitsinghal
  • 3,855
  • 13
  • 45
  • 84
0
votes
1 answer

What is client.setConnectTimeOut & client.setReadTimeOut?

Can someone please explain why one uses this client.setReadTimeOut and client.setConnectTimeOut timeouts? I am using the same with my Jersey client. I have set a timeout of 5 secs for both connect and read. And for testing purpose I have put a…
Sandiip Boa
  • 1
  • 1
  • 3
0
votes
0 answers

Using Twitter search API

I am trying to build a Jersey Rest Client to use the Twitter search api. The code is as folows: package twitter.client.example; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import…
0
votes
1 answer

Neo4j server seems to drop connection when processing for 200 seconds

I've been writing a Neo4j server extension (as described here, i.e. a managed server extension: http://docs.neo4j.org/chunked/stable/server-plugins.html). It should just get a string via POST (which in productivity would hold information the…
khituras
  • 1,081
  • 10
  • 25
0
votes
1 answer

Can Java EE Application Make HTTP Calls?

Can a Java EE Application -- a Servlet or a Session Bean -- make HTTP calls and still conform to portability standards? (assuming that the caller gracefully handles communication failure or unavailability of network) Furthermore, can a Java EE 7…
necromancer
  • 23,916
  • 22
  • 68
  • 115
0
votes
2 answers

How to parse HTTP 400 response using Jersey Client into a Java Class?

I am using Jersey client to interact with the Facebook Graph API. The Jersey client helps me parse JSON responses into Java classes. Sometimes Facebook sends a 400 response along with useful information about the reason for the 400 response. For…
necromancer
  • 23,916
  • 22
  • 68
  • 115
-1
votes
3 answers

Calling API again if it returns Http 401

I am calling below API using jersey JsonObject response = ConnectionUtil.getwebTarget() .request(). header("Authorization", "Bearer "+ access_token) …
Shruti sharma
  • 199
  • 6
  • 21
  • 67
-1
votes
1 answer

Jersey WebResource Dynamic Headers

I want to be able to set header dynamically. This line works for me: WebResource webResource = client.resource(doSomethingURL); webResource .header("test1", test1) .post(ClientResponse.class, postData); But it makes…
-1
votes
1 answer

Maven - javax.net.ssl.SSLException: java.security.ProviderException: Could not derive key

I added a client jar of project A to project B. They both have different versions of jersey and jackson apis. Both java 8. When I bring up the Application , it works fine. All dependencies are resolved and endpoints work fine. But when I run…
NewQueries
  • 4,841
  • 11
  • 33
  • 39
1 2 3
54
55