Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
I was looking for Difference between web API and Web services and WCF.

Thanks
Posted
Updated 4-Oct-13 9:39am
v2
Comments
Sergey Alexandrovich Kryukov 4-Oct-13 15:01pm    
Totally incorrect question and wrong direction of thinking. Try not to ask about "difference", you won't be able to define what the "difference" is.
What do you mean by "real time"? Do you know what "real time" is? All you need is to write on each concept, separately.
—SA
Coldcreek 4-Oct-13 15:36pm    
Hello Sergey,

Thanks for your response.Each time I ask any question ,you always respond .(But not in a positive way.)

Please tell me how should I ask questions online.I know you are experienced person but for a person like me who has less experience what should he do.

Please don't take this in negative manner.If my way of thinking is wrong then what is the correct way?? ...

I have found similar questions on code project about APIs and web-services .I am also asking in that similar way. At-least am not bullying anybody around here.....

Wish you all the best .
Thanks and Regards...
Sergey Alexandrovich Kryukov 4-Oct-13 17:25pm    
Thank you for your note. And thank you for understanding. I must say, the way I respond depends on the inquire. I only mentioned one aspect: "difference" is usually incorrect thing. Try, for example, answer the question: "What is the difference between apple Apple?". Another example would be: "What is the difference between Titanic and navigation?". You cannot tell the difference between general/abstact and concrete/specific subjects, and nearly any other notions. In your case, API is an abstract category, "Application program interface", and WCF is a particular Microsoft framework. There is no a basis for "differences". The question lacks real subject.

In this particular case, this is not about how to ask, but about what to ask about. Not about a "way". You should have read on each concept and see if there is something you don't understand, or perhaps something which may be related to your work. And the examples should better be driven by your. Do you understand that a limited number of examples (and, in case, of this forum, very limited cannot define a field? Ask yourself: what do you really want to know about, say, WCF. And remember that there is no the verbal knowledge. It does not really exist (unless this is about a science about words: linguistic, cognitive sciences, etc. :-) Words and names of things are important, but they would mean nothing without understanding of essence of things.

Also, you should not perceive negative response negatively. If you get something wrong, someone can help you by pointing it out. All progress is based on criticism. It never means anything negative on a personal level. (Such negative personal attitudes do sometimes take place, but normally only in case of compromised practical ethic, which has nothing to do with you.) By the way, I just looked through your questions and did not found even any criticism from me. Of course it could have happened on the pages with deleted questions, I cannot remember...

I'm not sure it it can help you, but I tried hard... If you some thoughts or questions, I'll try to respond. :-)
—SA
Coldcreek 4-Oct-13 19:46pm    
Hello Sergey,

I respect you since you are Senior Programmer and very knowledgeable person.
May be you are right in your approach (One of my Maths Professor was also like you ).
Thanks for explaining me in such detail.I will definitely work on your points.

I wish we keep in touch in future.
Good Night.



Sergey Alexandrovich Kryukov 4-Oct-13 19:48pm    
Great. Wish you the best of luck.
—SA

1 solution

Web Service

1.It is based on SOAP and return data in XML form.

2.It support only HTTP protocol.

3.It is not open source but can be consumed by any client that understands xml.

4.It can be hosted only on IIS.

WCF

1.It is also based on SOAP and return data in XML form.

2.It is the evolution of the web service(ASMX) and support various protocols like TCP, HTTP, HTTPS, Named Pipes, MSMQ.

3.The main issue with WCF is, its tedious and extensive configuration.

4.It is not open source but can be consumed by any client that understands xml.

5.It can be hosted with in the application or on IIS or using window service.

WCF Rest

1.To use WCF as WCF Rest service you have to enable webHttpBindings.

2.It support HTTP GET and POST verbs by [WebGet] and [WebInvoke] attributes respectively.

3.To enable other HTTP verbs you have to do some configuration in IIS to accept request of that particular verb on .svc files

4.Passing data through parameters using a WebGet needs configuration. The UriTemplate must be specified

5.It support XML, JSON and ATOM data format.

Web API

1.This is the new framework for building HTTP services with easy and simple way.

2.Web API is open source an ideal platform for building REST-ful services over the .NET Framework.

3.Unlike WCF Rest service, it use the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formats)

4.It also supports the MVC features such as routing, controllers, action results, filter, model binders, IOC container or dependency injection, unit testing that makes it more simple and robust.

5.It can be hosted with in the application or on IIS.

6.It is light weight architecture and good for devices which have limited bandwidth like smart phones.

7.Responses are formatted by Web API’s MediaTypeFormatter into JSON, XML or whatever format you want to add as a MediaTypeFormatter.

To whom choose between WCF or WEB API

1.Choose WCF when you want to create a service that should support special scenarios such as one way messaging, message queues, duplex communication etc.

2.Choose WCF when you want to create a service that can use fast transport channels when available, such as TCP, Named Pipes, or maybe even UDP (in WCF 4.5), and you also want to support HTTP when all other transport channels are unavailable.

3.Choose Web API when you want to create a resource-oriented services over HTTP that can use the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formats).

4.Choose Web API when you want to expose your service to a broad range of clients including browsers, mobiles, iphone and tablets.

For More info Check This:

Difference between WCF and Web API and WCF REST and Web Service

I hope this will help to you.
 
Share this answer
 
v2
Comments
Coldcreek 4-Oct-13 16:52pm    
Thanks Sampath..
Sampath Lokuge 5-Oct-13 2:55am    
You're warmly welcome :)

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