I was wondering what everyone's thoughts are on allowing WebAPI to be contract based as well as ReSTFul. I am a big believer that both have their place and I could definetly see advantages to providing my current MVC applications the ability to use the WCF contract technique our WCF services provide while also providing a ReSTFul API for third party applications that need access to our data. Also, I know that most examples show the ability to do this by having the WebAPI part of your MVC project, but I wish to have them on seperate machines for various security or availability concerns.
preguntado el 25 de agosto de 12 a las 15:08
In my opinion WebAPI is still going through a lot of changes. I like where it's headed, but the latest OData implementation for web api is in alfa, and it does not implement the full Especificaciones de OData. I'm also not to excited about losing contracts, forcing server side calls to use strings.
If I were implementing something today I would consider a combination of Servicios de datos WCF y Descanso WCF. This will give you the same RESTful interface and OData support from WebAPI, but will also expose contracts for the code-behind stuff.