It’s funny, when alternative technologies comes out that do a similar thing to a previous technology, people are very quick to pronounce the previous technology as dead. I was talking to someone the other week at a different company who said that their architects wanted to use WebAPI because WCF wasn’t relevant any more. This made me think, WHAT!!, REALLY!!, SURELY NOT!!
In the rest of this article I want to briefly cover what WCF and WebAPI are, talk a bit about the differences, and then suggest the reasons why you may use either. This isn’t an exhaustive discussion, but the point is that you can have various technologies doing similar things, without either one of them being redundant. I have spent the last 7 years of my career being involved in service architectures built using WCF and I am certainly not thinking I need to replace any of those systems just yet.
In this article I want to discuss a web services architecture that I have worked with over the last 7 years in a couple of different companies. The architecture I am discussing composes web services into layers, but there is much more to it than that. Nothing in this article is rocket science to an experienced services developer, but it is a way of working that has proven very reliable and easy to understand for developers that gets them working in a consistent way.
The diagram above shows what you will typically be used to working with in an enterprise. It is a standard 3 tiered architecture comprising of the following layers:
Presentation Layer: This contains any views that your users will interact with like, web sites, smart phone applications, desktop clients, etc.
Business Logic Layer: This contains the under lying logic for your application which may be comprised of web services, REST Services, windows services etc. The presentation layer shouldn’t contain any business logic and therefore should be quite dumb to the inner workings of your system, this is what the Business Logic Layer is for.
Data Layer: This contains your data storage. This typically is an SQL database (SQL Server, Oracle, and MySQL) or one of the newer blend of NoSql Databases (RavenDB, MongoDB, Cassandra). Typically your data layer may expose stored procedures to the Business Logic Layer, or your business logic may connect via an Object relational mapper such as Enterprise Library, NHibernate or SubSonic.
This article is going to concern itself predominantly with the Web Services part of the Business Logic Layer.
In this article I have collated a few training links about Windows Communication Foundation. I will keep adding to this page as I find other useful free resources. If you have any videos or articles that you feel would be useful here then please let me know in the comments and I will add them to the post. I would like it to be an archive of good material.
This training page contains tutorials for WCF. This page also contains links to useful sites with more information about WCF Bindings including the basicHttpBonding, wsHttpBinding, netTcpBinding, Names Pipes and the netMSMQBinding.
There is also a section on hosting WCF services in IIS, as self host windows services and also using IIS and the Windows Activation Services (WAS). There is also a section about performance tuning WCF services.
In this section you will find links to some basic WCF tutorial to help you get started in services development.