• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Exposing Methods as RESTFul Services

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am having a method which has two parameters in its signature like this:



What I want to do is to make this method available via REST like this:



Is it possible to expose this method as a RESTFul service method although it has more than one entity in its signature?

I ask this because in jersey's api I do not see any way to pass more than one entity to the webResource when calling post()-method.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I am afraid that the subject of your posting - "exposing methods as RESTful services" shows that it would be good to read a little about the concepts behind RESTful web services before trying to implement one.
RESTful web services are not about exposing operations, it is about exposing resources on which you perform a very limited set of operations (usually GET, POST, PUT, DELETE).
Of course you can expose your method as a web service, but it won't be REST. In your case RPC would be a viable option: http://en.wikipedia.org/wiki/Remote_procedure_call

If you want to create a RESTful web service that creates orders, then you can POST the representation of an order, consisting of, among other things, a number of items, to, for instance, http://myserver/resources/orders.
Best wishes!
 
Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic