Reputation: 406
Is it possible to expose whole application build on spring webflow as a web service? If it can be done does it make more sense to create an end point in action class or DAO class? How can the flow be handled using web services?
Upvotes: 0
Views: 991
Reputation: 11
We've done some work where the webflow is itself essentially exposed as a RESTful (ish) API. The view states are collection+json payload with hypermedia links modelling the transitions. I don't quite get the bit about action vs DAO class - for us the view states are the payloads returned to the client - the actions are invisible to the client. There are some gotchas essentially around how RESTful SWF is by default - as such we subclassed quite a bit, and defined our own FlowController subclass to muck with the URIs and HTTP verbs.
Upvotes: 0
Reputation: 5115
Web Flow is for multi-step, stateful interactions with a user. Not typically what Web Services are for.
You can certainly use Spring MVC Controllers for (HTTP-type) Web Services, and mix them into the same application where you also have Spring Web Flow flows for user interaction.
We're doing that for an application where a partner site sets up a transaction with us through a Web Service call, then redirects their user to our flow to interact directly with us for one part of the overall process.
(Similar to your other question Reason to integrate Spring Web-flow with Spring MVC)
Upvotes: 1