It was a great speaking experience for me last Wednesday; I presented in front of the Richmond dot net community and I think it went well. The topic was WCF and how it differs from the existing ASMX web services.
I could not make two demos work during the presentation. At that time I had no clue what went wrong! I just found out why those demos did not work :)
Actually I keep my technical stuff (files, presentations, books, etc) in a separate folder. So I created demos for the presentation and that folder existed under my technical stuff folder. IIS virtual directories were pointing to the folders underneath that and everything was working fine!
One day before the presentation, I copied the folder that had the actual presentation file to the temp folder on C drive. I did not realize but I had also copied the samples folder along with that to the temp folder. During the presentation, I opened up the Visual Studio 2005 project right from the temp folder (instead of opening it from the technical stuff folder), hence whatever code changes I made during the demo did not work because code was not getting updated in the folder that were mapped to IIS virtual directories!
I ran the ASP.NET compatibility mode demo and it worked as expected.
I got the following message when the mode was turned off:

And the following message when the mode was on (remember I was trying to return the HTTP headers?)

Anyways, I have attached the sample code with this post, so download it. Make sure to unzip the files to a folder, and create two virtual directories named Services and ASMXServices which should point to the respective projects.
I have also written some basic tips in the web.config file under the Services project.
The samples solution contains four projects:
Contracts – contains the service and data contracts (I have added a data contract also just to show how a simple data contract is defined)
Services – contains the actual WCF service implementation. It has two services; Calculator and ServerInfo.
ASMXServices – contains an ASMX web service, Config.asmx; I have used WCF attributes to expose this service as a WCF end point as well! This simple sample shows how you can expose your existing ASMX services as WCF services.
Client – contains the client code, proxies and the config file.
Any questions, comments? Let’s discuss those here.
WCF and ASMX Web Services Presentation and Samples.zip (4.02 MB)