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


Please can any one tell me why we use WCF and Web Service in asp.net ?





Thanks in Advance..
Posted

1 solution

Short answer - No, we don't. Who told you that we have to use Web services and WCF (the web service framework in .NET) in ASP.NET?

Long answer - Actually, IIS can handle all of the requests coming to a website and/or going from the website to the client. You don't need the WCF framework in an ASP.NET website. If someone told you, that you need one. Then he is idiot, and would definitely not know what ASP.NET and WCF is built for.

WCF is just a framework, for build client-server applications, making one of them act as a server or a hub and letting others to connect to it and to trigger quite bunch of functions on the hub; such as uploading the photos, marking yourself as present on duty and so on. A website on the other hand, acts similarly. User enters, performs his act and then logs out.

I have had developed a lot of ASP.NET websites, and quite a few WCF projects. I have found them similar frameworks, the difference is that you don't have to write anything specific to make sure that the requesting device is a client. Instead, any browser can reference your website by calling your URL. In WCF you have to make a client device, you add a few references to teach the device, that it should request the hub to answer to its calls and vice versa. They act similarly, you make request, perform some actions, and the response is shown to you in the application.

Final answer is, that you do not mix WCF framework with ASP.NET application while programming in ASP.NET environment. Where you can still mix them up whenever you need; for example while creating a WCF client you can use an ASP.NET website as a client.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 28-Feb-15 12:56pm    
Not sure the "question" deserved anything except 1st paragraph, but a 5.
—SA
Afzaal Ahmad Zeeshan 28-Feb-15 13:02pm    
Thanks for your 5, sir. Sometimes, I speak a lot.
Sergey Alexandrovich Kryukov 28-Feb-15 13:32pm    
No, no, this is not about talking too much... Your speech is clear enough, I think.
—SA
Afzaal Ahmad Zeeshan 28-Feb-15 23:00pm    
I would always try my best to be clear enough for everyone. After all, of what good is experience if it is not clear enough for young ones to learn from. :)
Sergey Alexandrovich Kryukov 28-Feb-15 23:42pm    
You are right, but here I only meant some "quality of speech". "Speaking too much" could be negative if it is a result of poor integrity and accuracy of speech, low culture, which could lead to awkward expressions which are, at best, needs more and more clarifications which make the speech longer, distract from the essence of things, and so on. We all can always improve and improve it (after all, look how much text it took for me to express this simple idea :-) But if you write some more trying to help more, share some idea or advice which could be useful and important, adding more text could be considered as virtue (but not everyone understands that).

Here, I tried to emphasize that your post was long enough in the second, good aspect. Say, referring to your own experience could formally be considered superfluous, but in essence it gives better idea on how this kind of development looks from practical point of view, for example. You are trying to give a hint on how you would advise to think at development of such project. It takes a lot of attention of the reader to be understood, but it gives the reader a chance to get more than the mere answer, which I think is invaluable.

Even though I expressed some doubt that the inquirer deserves it all, at the same time I think everyone deserves some credit, at least at first. :-)

Cheers,
—SA

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