File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Restful Webservices on fly(dynamically) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Restful Webservices on fly(dynamically)" Watch "Restful Webservices on fly(dynamically)" New topic

Restful Webservices on fly(dynamically)

Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

Hi Folks,

I would like introduce some dynamic cabability of exposing the spring bean as restful services

scenario is

1) i need to read the list of spring bean id's from fileat runtime( or during the loading time of web app)
2) based on bean id's i fetch from step 1 , i need to some how expose the beans as restful services

is there a way to acieve the same ?

Thanks, Ganesh Gowtham
Roger Sterling
Ranch Hand

Joined: Apr 06, 2012
Posts: 426

Yes, you can, but it's not turn-key or plug-and-play. You need to write the code to perform the initialization and re-initialization.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2062
Ganesh Gowtham,

May I know in what situation would such dynamism be ideal?
Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

Scenraio is something of this sort ...

In our project we have couple of Spring beans save POJO ( service layer which talks to dao ...)

During the spring context startup, i would like to expose configured beans as Restful services ...

As @Lance said, i need to tweak or extend or customise the spring loading stuff to acieve the same ...

Any examples or WIKI or idea would be really appreciated.

Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 124

Apache CXF can help you here. you just need to give some configurations saying which all beans are to be made available as a web-service.
I agree. Here's the link:
subject: Restful Webservices on fly(dynamically)