Mobile Zone is brought to you in partnership with:

Mitch Pronschinske is the Lead Research Analyst at DZone. Researching and compiling content for DZone's research guides is his primary job. He likes to make his own ringtones, watches cartoons/anime, enjoys card and board games, and plays the accordion. Mitch is a DZone Zone Leader and has posted 2576 posts at DZone. You can read more from them at their website. View Full User Profile

Actions Come to WCF Data Services

10.21.2011
| 3737 views |
  • submit to reddit
There's a great tutorial already available on a new update that Microsoft is making to the Windows Communication Framework.  WCF is getting support for "Actions":

The October 2011 CTP of WCF Data Services adds powerful, but incomplete support for Actions. The motivation behind Actions stems from wanting to advertise in an OData entry an invocable ‘Action’ that has a side-effect on the OData service.

Actions will provide a way to inject behaviors into an otherwise data-centric model without confusing the data aspects of the model, while still staying true to the resource oriented underpinnings of OData.
--dpblogs, MSDN

The tutorial on this new feature, which is useful to you Windows Phone developers out there as well, will take you through, Using WCF Data Services to Invoke an Action, Setting up a WCF Data Service with Actions, and the features that are coming soon.

Source: http://blogs.msdn.com/b/astoriateam/archive/2011/10/17/actions-in-wcf-data-services.aspx

Comments

Schlacter Adam replied on Sat, 2012/04/14 - 3:17am

The example '/GetMoviesbyGenre' is an RPC. So using actions in this way is not in the least bit RESTful. Actions can be RESTful, but only if they apply to a set of URIs as part of the uniform interface constraint. If a subset of your URIs are for resources that all support the same set of actions for their lifecycle, then actions could be used in a RESTful way. Unfortunately, the example you give is exactly the opposite. Instead of the RPC, a RESTful interface would use GET on /Movies?genre='comedy' which of course doesn't need actions.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.