Questions tagged [javax.ws.rs]
54 questions
1
vote
0 answers
Not able to parse XML retrieved from API call
I am trying to parse an XML document which I got in a javax.ws.rs.core.Response through a GET API Call made to a javax.ws.rs.client.Client instance. But I get this error as shown below:
com.fasterxml.jackson.databind.exc.MismatchedInputException:…

Pavan Vasan
- 391
- 1
- 9
- 28
1
vote
2 answers
DocuSign API integration issue with RESTful Web Services : javax.ws.rs-api-2.0.1.jar
My project is using DocuSign API to post Envelope with the Java client:
docusign-esign-java-3.2.0.jar
It works fine, but the project also needs to use jCloud with another lib dependency:
javax.ws.rs-api-2.0.1.jar
The server (tomcat) gets an…

Francois G
- 11
- 3
1
vote
0 answers
Wildcard Consume javax.ws.rs
Would like to accept all requests independent on the Content-Type set in header.
As an example a Content-Type can be application/json. By then setting:
@Consumes(MediaType.WILDCARD)
Will respond: HTTP 415 Unsupported Media Type
But if the consume…

Grains
- 950
- 3
- 16
- 35
1
vote
1 answer
How to redirect a javax.ws.rs.client.WebTarget Post request via a Proxy
I have an a server that is trying to make a POST call to an external IP, unfortunately if I make the call directly it is blocked by an internal firewall.
However we do have a proxy that allowed outbound http traffic, if I redirect the POST call via…

Alex
- 80
- 6
1
vote
2 answers
Netty websocket and Rest in same Java application
I have an exisiting Java application which is exposing REST services. I want to add a new feature in the same application to handle web socket requests (using netty) along with the exisiting REST services. How can I do that without changing my REST…

codeguru
- 163
- 2
- 13
1
vote
0 answers
What should I return without pictures?
I have an API.
@GET
@Path("picture")
@Produces("image/jpeg")
Response getPicture(@QueryParam("key") String key);
The corresponding service.
@Override
public Response getPicture(String key) {
try{
byte[] image = service.getPicture(key);
…

dai
- 1,025
- 2
- 13
- 33
1
vote
2 answers
Jersey: how to access the global application object?
I'm creating a REST web application with Java, Tomcat and Jersey. I'm using annotations (no web.xml!) I ended up using this application configuration:
package com.my_own.server;
import java.util.Properties;
import…

nagylzs
- 3,954
- 6
- 39
- 70
1
vote
0 answers
Does javax.ws.rs.client.Client cache the response data
I'm having javax.ws.rs.client.Client as a singleton using Guice dependency injection and have multiple threads in my threadpool share the singleton object.
@Provides
@Singleton
protected Client provideRestClient() {
log.info("Http client…

kane.zorfy
- 1,000
- 4
- 14
- 27
1
vote
1 answer
REST-ful webservice @Context Injection always returns null
I am creating my first Restful web service with Embedded Jetty with authentication and authorization and I have a filter in which I would like to inject a user object (Employee) which then I can retrieve in a service bean using…

F. Zamfirov
- 103
- 1
- 7
1
vote
1 answer
How to merge multiple path parameters into one object
I have a route that looks like this:
/foobar/123/2
And I would like to use all three parameters to get a single object so that I can use something like this:
@Path("/{type}/{id}/{version}")
public Response getEntity(Entity entity);
Instead…

spezifanta
- 675
- 8
- 11
1
vote
1 answer
Can I use Map<> in query params?
Can I use Map in query params?
I have a number of resources for REST and I want to change list of query params in one place, I have a such source:
@GET
@Path("...")
@Produces({MediaType.APPLICATION_JSON})
public String getPath(
…

mystdeim
- 4,802
- 11
- 49
- 77
1
vote
1 answer
Dropwizard Validate @FormParam
How do I validate that @FormParams, for a POST request, are not empty?
We are using Dropwizard version 0.9.3.
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response addCard(@FormParam("title") @NotEmpty String title,
…

mskager
- 51
- 1
- 2
- 10
1
vote
1 answer
Extract String from javax Response
Please, I have this Response and I want to extract the content as a String
Response res = Response.status(Response.Status.OK)
.entity(new GenericEntity(app) {
…

Mehdi
- 2,160
- 6
- 36
- 53
0
votes
1 answer
Specify raw query string when using WebTarget
I'm working with a large existing project, which utilises javax.ws.rs.client.WebTarget to talk to RESTful API. The API is developed by a third party and I have no control over it. I need to make a request in the following…

Aleks G
- 56,435
- 29
- 168
- 265
0
votes
0 answers
Jersey Dependency Tree Issue
Previously we are using Jersey 1.17 and org.apache.cxf 2.6.0 version for different components of our project . Now our proj migrated to Jersey 1.19.4 and cxf 3.2.6 . I saw jersey 1.19.4 holding javax.ws.rs:jsr311-api:jar:1.1.1 where as cxf 3.2.6…