The request is routed to an action on your controller that uses the model (which you define is just a structure that represents the data that your actions and presentation will act). This action returns an ActionResult
, which is often, but not required, a ViewResult
(which essentially just executes the specified view page using the specified model, if any). However, you do not need to return the View; You can create any kind of ActionResult that you want. You can return XML, JSON, SOAP, binary content, whatever.
MVC retains its nature, but it does not strictly adhere to REST and can be adapted to what you consider necessary. You could say that your controller says SOAP, but my question is: why would you, if this work has already been done for you in other technologies (for example, WCF)?
source share