ASP.NET Web API – A New Way to Handle REST
Web API is the first real alternative to WCF that .NET developers have seen in the last six years. Until now emerging trends such as JSON were merely exposed as WCF extensions. With Web API, developers can leave the WCF abstraction and start working with the underlying HTTP stack.
Web API is built on top of the ASP.NET stack and shares many of the features found in ASP.NET MVC. For example, it fully supports MVC-style Routes and Filters. Filters are especially useful for authorization and exception handling.
In order to reduce the amount of mapping code needed, Web API supports the same Model binding and validation used by MVC (and soon to be released NET Web Forms 4.5). The flip side of this is the content negotiation features. Web API automatically supports XML and JSON, but the developer can add their own formats as well. The client determines which format(s) it can accept and includes them in the request header.
Making your API queryable is surprisingly easy. Merely have the service method return IQueryable<T> (e.g. from an ORM) and it Web API will automatically enable OData query conventions.
ASP.NET Web API can be self-hosted or run inside IIS.
first real alternative
by
steven casey
Re: first real alternative
by
Jonathan Allen
Then there is the strange decision to reinvent stuff that is unrelated to the core functionality of OpenRasta. This shouldn’t be shipping with its own IoC container, it shouldn’t even need one. That is something that the developers should decide for themselves. And then there aforementioned logging API, which completely ignores .NET’s official API (TraceListener) as well as the popular alternatives. Heck, it even has its own package manager that simply wraps NuGet.
The whole love/hate relationship with ASP.NET is very confusing, but not as confusing as their project pages. When I go to get the bits from their home page they aren’t even sure if I’m supposed to be using OpenWrap or NuGet. And the only link they provide is to their “stable” repository, which really contains the obsolete branch. (Which in a way means that it is stable.)
I like writing about open source alternative’s to Microsoft’s .NET libraries. We need that competition to better the platform as a whole. But I can’t recommend something in this state. They need a lot of help to clear out the cruft and focus on the core feature set.
Re: first real alternative
by
Demis Bellot
www.servicestack.net has been Open Source and shipping on Production systems for over 4 years has amassed over 47 contributors and is the 11th most watched C# project on GitHub and yet it fails to meet your definition as an alternative?
What about it shipping the fastest text serializers for .NET? Like the kind StackOverflow had to switch to in order to get decent JSON performance:
blog.stackoverflow.com/2012/02/stack-exchange-o...
StackOverflow Careers also uses ServiceStack for all its Back Office web services, which makes use of all ServiceStack's components: JSON Serializer, C# Redis Client, OrmLite database since they are all lean libraries that work with clean POCOs and provide great performance:
www.servicestack.net/benchmarks/
Here's an answer on StackOverflow that compares ServiceStack vs WebApi - I recommend getting familiar with the alternatives that *DO* exist before claiming otherwise in all sincerity.
stackoverflow.com/questions/9699083/servicestac...
Educational Content
Intro to CLP with core.logic
Ryan Senior Jun 18, 2013
Spock: A Highly Logical Way To Test
Howard Lewis Ship Jun 18, 2013
Java Garbage Collection Distilled
Martin Thompson Jun 17, 2013
C++11 The Future is Here
Bjarne Stroustrup Jun 16, 2013
The Big Data Revolution
Claudia Perlich Jun 16, 2013




Hello stranger!
You need to Register an InfoQ account or Login to post comments. But there's so much more behind being registered.Get the most out of the InfoQ experience.
Tell us what you think