• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Problem with RESTapi endpoint manipulation

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a dropwizard application to POST/GET query information. I have a `@POST` method that populates an arrayList with my query and its' 11 parameters. For brevity, I cut the example down to only show 3 parameters.

   

I can send a get request through ARC and it will return successful with a json representation of the query.

I run into issues when I try to make a `@GET` request on the specific `queryId` and return a specific parameter of it. As such,

   

On the rest client I make a get request to

I'm expecting that to return the action type of that specific `queryId`, but instead is returning null.
 
Saloon Keeper
Posts: 2783
367
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dj Marlins wrote:


The template in the @Path annotation only specifies only path parameter: queryId.

Did you mean have this?:

 
Dj Marlins
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

Dj Marlins wrote:


The template in the @Path annotation only specifies only path parameter: queryId.

Did you mean have this?:



Yes I did mean to have that.
 
Dj Marlins
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I make a request like this:


It is returning the string output of just "action", how can I get it to return the action of the query I populated in the arrayList object?
 
Ron McLeod
Saloon Keeper
Posts: 2783
367
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dj Marlins wrote:... It is returning the string output of just "action" ...

What URI are you using to call the web service?

Dj Marlins wrote:... how can I get it to return the action of the query I populated in the arrayList object?

Where is the ArrayList?  I don't see one in the code that you posted.
 
Dj Marlins
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URI I'm using is



I wish to have it return "encrypt".

Currently I have



Which when hitting that endpoint returns
 
Ron McLeod
Saloon Keeper
Posts: 2783
367
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well .. you are making a call which gets handled by this method:
Using this URI:
Which means the path parameters get set as follows:
    queryId = "b622d2c6-03b2-4488-9d5d-46814606e550"
    eventType = "eventType"
    action = "action"

And you are returning a String value of: "Get action parameter: " + action

And the client application is seeing:
Seems correct to me - why would you expect anything different?
 
Ron McLeod
Saloon Keeper
Posts: 2783
367
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dj Marlins wrote:


How are these two handlers related?
 
Dj Marlins
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How are these two handlers related?

The top one is used to generate a query with the desired arguments, and I want to retrieve each argument in the query through individuals @GET requests.
 
Dj Marlins
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:


How are these two handlers related?


The @POST method returns the query. So I have 10 separate @GET requests with corresponding endpoints to return each parameter within the query.
 
We don't have time for this. We've gotta save the moon! Or check this out:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!