Showing posts with label ASP.NET WEB API. Show all posts
Showing posts with label ASP.NET WEB API. Show all posts
Saturday, December 14, 2013

ASP.NET Web API vs WCF

With Microsoft.NET Stack there are lots of way to create service like ASP.NET Web Service, WCF(Windows Communication Foundation) service and now ASP.NET Web API. The developer often get confused mainly between WCF Service and Web API. So I thought it is a good idea to write a blog post to about differences between ASP.NET Web API and WCF Service.

Difference between ASP.NET Web API  and WCF Service:


  1. WCF services support multiple transport support like HTTP,TCP,UDP,MSMQ and allow switching between them while ASP.NET Web API is used only http based services best suited for http service and mobile based application back end service. It is an quick and easy way to create http service.
  2. WCF support multiple encodings like Text,MTOM while ASP.NET Web API support wide range of media types like XML,JSON etc.
  3. WCF Service support Request-Reply, One way and duplex exchange patterns while HTTP service only support Request/Return pattern.

When to choose? What? WCF or Web API


  • Choose WCF if you want to support any other transport protocol then HTTP.
  • Choose Web API when you want to create resource oriented services very quickly.
  • Choose Web API when you want to serve wide variety of clients like browsers, mobile etc.
  • Choose WCF when you want to support message queuing, one way messaging and duplicate message communication.
Share:
Saturday, May 4, 2013

Simple data binding with Knockout, Web API and ASP.Net Web Forms

In this post We are going to see How Knockout, ASP.Net Web API and ASP.Net works together smoothly. There are lots many examples of ASP.Net MVC,Web API and Knockout.js available on web working together  nicely. So I thought it will be a good idea to write a blog post about how ASP.Net Web API, ASP.Net Web Forms,Knockout.js works together and how we can create simple data binding with Knockout.js.

ASP.Net Web Forms:


As we all know ASP.Net Web Forms is one of premier development technology widely use in creating web sites and web applications. ASP.Net Web Forms allow to create dynamic websites using event driven model. It is one of the easiest way to create web applications and web sites.


ASP.Net Web API:


ASP.Net Web API is a framework that allows to build HTTP Service that reach a broad range of clients including browsers and mobile devices.It provides very easy way to write restful http services. Its can be access by any type of client over HTTP protocol. Client can make a GET, PUT,POST and DELETE request based on its requirement and get the response appropriately.

Knockout JS:


As per knockoutjs.com, Knockout is a JavaScript library that helps you to create rich, responsive display and editor user interfaces with a clean underlying data model. It provides a way to declarative bindings using an ‘Observable’ view model on browser. It supports two way bindings.
Share:
Friday, May 25, 2012

ASP.NET Web API Basics

We have seen that now web is really becoming cross plate form and you can see your services or API can be exposed to any client. Till now one of big challenges is to choose platform for this kind of service. There are so many options available like web services, WCF services,Generic Handlers, directly writing responses on aspx page etc. There are plenty of options available and each one has their own pros and cons.  But now we have one simpler answer for that is ASP.NET Web API.

What is Web API?

ASP.NET Web API is a framework for building web API on the top of .NET framework. It’s a framework for building and consuming web services that can be use at broad range of clients like browsers,tablets phones etc. You can expose JSON or XML whatever you want to use.

Why to use Web API?

Think about a situation where a jQuery script that is making a ajax request and we need some thing who can expose data from the server to the client at that time WEB API can be very handy you can expose server data in XML or JSON form and you can make that call with simple http request. No lengthy code required to call WEB API.
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews