Service Stack

Sunday, October 6, 2013

Open Source alternative to WCF, MVC, Web API

Focus on speed and simplicity

Cross Platform!


  1. Code first, model drives all the services
  2. POCO and strong typing support
  3. Auto configuration of formats and endpoints
  5. Service stack provides: serializers, service endpoints, ioC Container, ORM, Caching out of the box
  6. Authentication

Create a new empty ASP.NET Project

Install Package ServiceStack

Register Service Stack in the web config

Create the Request and Response Entities

Create a Post Service

Bootstrapping: add global.asax and this code

Running the application

Define the routes

Create a new status service

New operation

Calling service from the browser

Specify the route

Result in browser, in html format

Add quantity posted to total and store in session object

Implementation of status service service

Implementation of console client application

Execution in the console window

Specifying a return type

No need to specify return type in client application

Default Success Warning Important Info Inverse
B S W I ? O