Orchard with Web Services

Topics: Core, Customizing Orchard, General, Writing modules
Nov 22, 2012 at 11:09 AM

Hi,

I am trying to build an orchard module which will export content items xml (among other things) through a web service (optionally WCF). Accessible through URL.

So far I was unable to find a module with those capabilities to copy the general structure from, or a reference/explenation of how to create the general structure for the webservice.

If you could please provide me with a code sample of the general structure or an example of a module already using these features.

Thank you :))

Developer
Nov 22, 2012 at 3:40 PM
Edited Nov 22, 2012 at 3:41 PM

Orchard has WebApi built in to the core. All you have to do is create a controller that inherits ApiController and you are good to go :)

http://sebastienros.com/web-api-makes-it-in-orchard

Nov 25, 2012 at 9:32 AM
Edited Nov 25, 2012 at 12:41 PM

Thank you :)

Can I implement this without installing webapi.all?

http://nuget.org/packages/WebApi.All

Because when i installed it on the latest version of orchard (1.6) it crashed the whole version -

apparently because webapi doesn't support .net 4.5 which the latest version is built on.

 

Developer
Nov 25, 2012 at 8:03 PM

You don't need 4.5 or WebApi.dll, you just need to use the dlls that are in the lib folder of your Orchard installation.