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
13
votes
2 answers

REST service that accepts and returns object. How to write client?

I have declared two REST web services. One which simply returns a object. And other which accepts an object and returns another object. POJO Order.java is used. @XmlRootElement public class Order { private String id; private String…
Kaushik Lele
  • 6,439
  • 13
  • 50
  • 76
13
votes
2 answers

Jersey 2 filter uses Container Request Context in Client Request Filter

I have a Jersey 2 Web Service that upon receiving a request, makes another request to another web service in order to form the response for the original request. So, when client "A" makes a request to my web service "B", "B" makes a request to "C"…
oggmonster
  • 4,672
  • 10
  • 51
  • 73
13
votes
2 answers

Jersey 2.6 with Jackson JSON deserialization

My goal is to make web calls and convert returned JSON to POJOs. I'm trying to use Jersey+Jackson for this but am getting exceptions when running. My maven pom file includes the following dependencies -
ashutosh
  • 649
  • 1
  • 8
  • 21
13
votes
3 answers

Jersey jax.rs client 2.5 follow redirect from HTTP to HTTPS

I have a setup where tomcat server hosting my REST servers redirects calls from HTTP (port 9080) to HTTPS ( port 9443 ). I'm using jersey 2.5 implementation and cannot manage to configure the clients to follow redirections. I've found this SO…
devlearn
  • 1,725
  • 2
  • 17
  • 30
13
votes
8 answers

Unable to Mock Glassfish Jersey Client response object

I am having problems with creating a mock Response object to use with my unit tests. I am using org.glassfish.jersey.core.jersey-client version 2.3.1 to implement my RESTful client and mockito version 1.9.5 to help me with mock objects. Here is my…
13
votes
2 answers

How to read JSON request body in Jersey

I have a requirement, where in i need to read JSON request that is coming in as part of the request and also convert it to POJO at the same time. I was able to convert it to POJO object. But I was not able to get the request body (payload) of the…
asfr
  • 133
  • 1
  • 1
  • 7
13
votes
3 answers

How to extract ObjectMapper from JAX-RS Client?

I am using Jersey JAX-RS client (version 2.0). I know it is using a Jackson ObjectMapper to generate and parse JSON. I want to use that same object to generate JSON for some java classes so that I can write them to a log. I know I can create a new…
necromancer
  • 23,916
  • 22
  • 68
  • 115
11
votes
1 answer

HTTP Stream dropping abnormally with java jersey client

For one of our project, we are consuming HTTP feed stream by using java jersey client With the client Feed consuming is fine, but after the 10 mins of time, stream dropping abnormally; even though stream producer is up and running and producing the…
Ram Kowsu
  • 711
  • 2
  • 10
  • 30
11
votes
1 answer

Closing connection in GET request using Jersey Client 2.22.1

I am using Jersey client for REST calls from Java code: org.glassfish.jersey.core jersey-client 2.22.1 In my GET request, …
Dev
  • 13,492
  • 19
  • 81
  • 174
11
votes
3 answers

REST JAX-RS javax.ws.rs.ProcessingException:

I am getting below exception whenever my REST client code makes a call to the REST service using below code: Code: public void putWatcher(Watcher watcher) { System.out.println("In REST Client putWatcher.***********"); target =…
user3275095
  • 1,605
  • 4
  • 24
  • 36
11
votes
3 answers

Jersey 2.8 client is not ignoring unknown properties during deserialization

I am using Jersey Client 2.8 and trying to register my own Jackson configurator which will sets custom ObjectMapper properties. public class ConnectionFactory { private final Client client; public ConnectionFactory() { ClientConfig…
Onkar Deshpande
  • 301
  • 4
  • 15
10
votes
3 answers

How call PUT through Jersy REST client with null entity

I want to call some "upgrade" REST API through Jersy client, which is declared as PUT and does not require any body content. But when I request this API as below: webTarget.request().put(Entity.json(null)); It gives error as below: Entity must not…
Atul Kumar
  • 719
  • 3
  • 8
  • 29
10
votes
1 answer

Jersey REST Client - Treat Custom MediaType as MediaType.APPLICATION_JSON

I'm writing a REST client using Jersey with JacksonFeature enabled for a webservice that forces me to specify their custom-named content type, even though it's just regular JSON. In other words, when I do this: Request request =…
kwikness
  • 1,425
  • 4
  • 21
  • 37
10
votes
2 answers

How to avoid dependency conflict when using dropwizard + jersey client

I have a DropWizard REST API written and works. One of the resource endpoints actually writes an email, however as soon as I add the following dependencies DropWizard starts to fail on start up com.sun.jersey
Manish Patel
  • 4,411
  • 4
  • 25
  • 48
10
votes
1 answer

Mock or build a Jersey InboundJaxrsResponse

I'm fairly new developing jersey client, and has run into some problems with some testing. First off all I maybe should mention that my application is all client side, no server side stuff at all. My problem is that I would like to create a Response…
Robert
  • 4,602
  • 4
  • 22
  • 33
1
2
3
54 55