Sunday, 14 January 2007

WCF in .net 3

WOW this is a really powerfully tool, forget sockets and web services they are so .net 2. WCF does the lot plus supports message queueing, aysnc processing (slow services well alert you when they have finished!) and even more impressively subscription (you can subscribe to a web service, and it tells you when it changes - think events but across the Internet!).

You can host WCF services within IIS (the same way you would handle current web services), or you can VERY EASILY host it within a Console App/windows service/Windows app (two lines of code!!!)

One thing to note - this is still a ctp and its obvious that it is lacking in certain areas. Most notably in the production of the proxy code. You currently have to run svcutil on your service dll, then you run "svcutil *.xsd *.wsdl". A bit nasty but sure to get better. Another thing worth noting is the quality error messages, double check everything you type especially in the config files.

I can think of a couple of apps of the top of my head that would defiantly have benefited from the ability to subscribe to a service. Cant wait to use this in anger!

If you want to have a play about with this then firstly take a visit to Microsoft and download the following files:-
Then follow the examples below at code project
  1. http://www.codeproject.com/WCF/WCF_CommOptions_part1.asp
  2. http://www.codeproject.com/WCF/WCFCommOptions_2.asp
  3. http://www.codeproject.com/WCF/WCF_CommOptions_part3.asp

Very well written examples, a couple of steps missed out perhaps but is easy enough to see whats missing!

Enjoy

Ross

No comments: