Labels

Wednesday, February 6, 2013

WCF and ASP.NET Web API

ASP.NET MVC 4 includes some fantastic new support for creating “Web APIs”. This enables you to easily create HTTP services and APIs that can be programmatically called from a broad range of clients (ranging from browsers using JavaScript, to native apps on any mobile/client platform). The new Web API support also provides an ideal platform for building RESTful services.

Should one use WCF or Web API?  Confused.. well here is the difference to help you use the apropiate.

WCF
ASP.NET Web API
Enables building services that support multiple transport protocols (HTTP, TCP, UDP, and custom transports) and allows switching between them.
HTTP only. First-class programming model for HTTP. More suitable for access from various browsers, mobile devices etc enabling wide reach.
Enables building services that support multiple encodings (Text, MTOM, and Binary) of the same message type and allows switching between them.
Enables building Web APIs that support wide variety of media types including XML, JSON etc.
Supports building services with WS-* standards like Reliable Messaging, Transactions, Message Security.
Uses basic protocol and formats such as HTTP, WebSockets, SSL, JQuery, JSON, and XML. There is no support for higher level protocols such as Reliable Messaging or Transactions.
Supports Request-Reply, One Way, and Duplex message exchange patterns.
HTTP is request/response but additional patterns can be supported through SignalRand WebSockets integration.
WCF SOAP services can be described in WSDL allowing automated tools to generate client proxies even for services with complex schemas.
There is a variety of ways to describe a Web API ranging from auto-generated HTML help page describing snippets to structured metadata for OData integrated APIs.
Ships with the .NET framework.
Ships with .NET framework but is open-source and is also available out-of-band as independent download.


Thanks & Regards,
Arun Manglick,

ASP.NET MVC 4.0 - New Features

Bundling and Minification — ASP.NET MVC 4 includes the new bundling and minification support we are also adding to ASP.NET 4.5. These features enable you to build web applications that load faster and feel more responsive to users, by minimizing the number and size of HTTP requests that your pages make. Included with the MVC 4 beta are new “cache busting” helper methods that enable easy proxy caching of bundled files (with automatic invalidation if you change the cached CSS or JavaScript). You can learn more about bundling and minification from my previous blog post about it.

Database Migrations — ASP.NET MVC 4 includes the new Entity Framework 4.3 release, which includes a bunch of great new features. One of the most eagerly anticipated features it provides is database migration support. This enables you to easily evolve your database schema using a code focused migration approach — and do so while preserving the data within your database. I’ll blog more about this in the future – you can also see a walkthrough of database migrations in this tutorial.

Web API — ASP.NET MVC 4 includes some fantastic new support for creating “Web APIs”. This enables you to easily create HTTP services and APIs that can be programmatically called from a broad range of clients (ranging from browsers using JavaScript, to native apps on any mobile/client platform). The new Web API support also provides an ideal platform for building RESTful services. I’ll be blogging much more about this support soon — it is really cool, and opens up a bunch of new opportunities. There are several tutorials, samples and screencasts covering ASP.NET Web API on the ASP.NET site to help you get started.

Mobile Web — ASP.NET MVC 4 includes new support for building mobile web applications and mobile web sites, and makes it much easier to build experiences that are optimized for phone and tablet experiences. It includes jQuery Mobile, and includes new support for customizing which view templates are used depending upon what type of device is accessing the app. See the ASP.NET MVC 4 tutorial series.

Razor Enhancements — ASP.NET MVC 4 includes V2 of our Razor View engine. Razor V2 includes a bunch of juicy enhancements that enable you to make your view templates even cleaner and more concise — including better support for resolving URL references and selectively rendering HTML attributes.

Realtime Communication with SignalR -


Thanks & Regards,
Arun Manglick,