< back

Detailed overview of Service Stack

With a primary focus on simplicity and speed, ServiceStack allows development of web services code-first, using normal C# objects. Using strong-typed DTO's provides a well-defined contract for your web service as well as enabling us to infer a richer intelligence about them, allowing the auto-generation of documentation metadata pages, auto-configuration of popular formats (XML,JSON,HTML,CSV,JSV) and endpoints (REST,RPC,SOAP), all without any configuration or code-gen required. All whilst still providing a clean, succinct, strong-typed API, for a friction-free development experience.

From end-to-end it's built using only the fastest open source components available. Avoiding all unnecessary overheads where possible, e.g. chosing only to use .NET's raw, lightweight IHttpHandlers.

When the .NET Framework fails to provide efficient implementations in our pipeline, we replace it with our own efficient implementations. As done in ServiceStack.Text now maintaining the fastest Text serializers available for .NET - now with JSON, CSV, JSV formats that are over 3.6x faster then the fastest JSON serializer in .NET.

Out-of-the-box it's also bundled with libraries to assist the development of high-performance and scalable web services with a multitude of caching options as well as the leading ServiceStack.Redis C# Client for Redis - The fastest NoSQL DB in the world.

Developed in the modern era, it has first-class support for IOC, testing and convention-based development enabling you to to develop your webservices entirely using pure, clean POCO DataContract's, decoupled from the endpoint that it is hosted on.

These same DTO's can later be shared with any .NET client application eliminating the need for any generated code.

Creating a web service is done by adding a new Request and Response DataContract and the Service to handle them. With just a single build and no other configuration required, they are immediately discoverable and callable.

Services can run on both Mono and the .NET Framework and be hosted in either in a stand-alone mode or together with an existing ASP.NET Web Application framework. or detached from a web server, inside a Windows Service or Console application.

Visualizing ServiceStack

Detailed overview of Service Stack

The diagram above shows all the custom code needed to host a simple web service in Service Stack.

No other endpoint configurations, mandatory base classes, Operation or Service Contract's are required - your service will just work.
It's well suited for SOA webservices development as you get the complete freedom of your Request and Response DataContract's to define your web service interface. Your DTO's define everything, Service Stack does not add any extra markup to your services - they're just pure DTO's over HTTP.

The endpoint protocols and webservice transport are abstracted away (although still discoverable) free-ing you to concentrate on implementing the web service logic against strongly-typed DataContract's. If your DataContract's are kept in a dependency-free seperate assembly, they can safely be shared with all your .NET service clients (including Silverlight) eliminating the need for any generated code.

The Xml and Json endpoints are efficient lightweight IHttpHandler's that allow your service to be called via REST HTTP GET requests, e.g:

/Xml/SyncReply/GetFactorial?ForNumber=2
/Json/SyncReply/GetFactorial?ForNumber=2

A dynamically generated /Metadata page (containing your webservices WSDL's) listing all your web services is also provided to assist service consumers discovering and accessing your services:

Service Stack metadata page
< back