3

I am working on an asp.net application (.net 4 framework) design and was wanting to know what are the pros and cons and best practices for using webservices vs WCF techology? This application will eventually be used by outside clients to consume data.

When would you use WebServices and when would you use WCF? Is one more scalable than the other?

user279521
  • 4,779
  • 21
  • 78
  • 109
  • 1
    WCF **IS** webservices - and a lot more. So your question should really be WCF vs. ASMX (ASP.NET Webservices) - then it makes sense. Also, this question has been discussed at length here on SO - just search for `ASMX vs WCF` and you should find PLENTY of posts.... – marc_s Jul 14 '10 at 15:51
  • 1
    possible duplicate of [What are the benfits of using WCF over ASMX web services?](http://stackoverflow.com/questions/1941481/what-are-the-benfits-of-using-wcf-over-asmx-web-services) – marc_s Jul 14 '10 at 15:58
  • Why can't I delete this question? – user279521 Jul 14 '10 at 16:09

2 Answers2

2

I would use WCF because it can do everything webservices (asmx) does; while giving you the flexibility to extend much further.

You can setup a simple WCF Service just as easily as an ASMX service through Visual Studio. So if you're "Fresh" on both technologies, I'd spend time learning WCF.

Depending on your specific use-case, you might might also look into WCF Data Services (.NET4) and Entity Framework. It basically gives you a nice API that you can use to consume your database over http/https. The beauty of WCF Data Services, is that you end up writing very little code to get at your data, and you can focus on consuming it.

WCF Getting Started -- http://msdn.microsoft.com/en-us/library/ms734712.aspx

WCF Data Services -- http://msdn.microsoft.com/en-us/data/ee720180.aspx

Nate
  • 30,286
  • 23
  • 113
  • 184
0

Webservice?

Webservice use SOAP (Simple Object Access protocol) and it is used to connect the web application using different type of technologies, and possible to connect the application that have hosted in different type of servers.

Disadvantage of Webservice

Webservice use only HTTP Protocol. It provides only singlex communication, not half duplex and full duplex communication. They work in an stateless fasion over HTTP and are hosted inside a web server like IIS

Advantages of WCF Service

WCF Service support HTTP, TCP, IPC, and even Message Queues for communication. We can consume Web Services using server side scripts (ASP.NET), JavaScript Object Notations (JSON), and even REST (Representational State Transfer). It can be configured to have singlex, request-response, or even full duplex communication. These can be hosted in many ways inside IIS, inside a Windows service, or even self hosted.

Half duplex

Half-duplex data transmission means that data can be transmitted in both directions on a signal carrier, but not at the same time. half-duplex transmission implies a bidirectional line (one that can carry data in both directions).

They work in an stateless fashion over HTTP and are hosted inside a web server like IIS

Full duplex

Full-duplex data transmission means that data can be transmitted in both directions on a signal carrier at the same time. Full-duplex transmission necessarily implies a bidirectional line (one that can move data in both directions).

Arun Prakash
  • 880
  • 10
  • 10