Click here to Skip to main content
15,936,903 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I have experience of working on web forms only but now wants to switch learning mvc. I want to ask question regarding web API that Web API in mvc is consumed by your javascript code only( single page application javascript frameworks, jquery) ? Can we used it in way we work with wcf like creating proxies and then passing server side entities and response in server side objects ?

Sergey Alexandrovich Kryukov 7-Feb-15 10:26am    
How could it be "client side only" if ASP.NET itself is a server-side technology?
touseef4pk 7-Feb-15 11:53am    
I haven't said it is client side. What I want to ask is how will we use it in place of wcf where we generate proxies. What will do in this case ?

1 solution

You can use WebApi with any client: JavaScript, Android, iOS, Windows App, etc. Any platform that can consume a web service will support Web API. So yes, Web API can be used in place of WCF. It is also much easier to setup and consume.

You can also pass/return server-side domain objects. By default, WebAPI serializes and deserializes using JSON, but that is configurable.

This is an example of WebAPI being consumed on Android:[^]
You can learn more about WebAPI here:[^].
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900