WCF: Basic Troubleshooting and More Resources

If you ran into a problem anywhere in the last few WCF articles I wrote, here are some things that might be giving you trouble:

Different Versions

If you know what you're doing, WCF is supported under many configurations.  When you're just getting started, though, you want everything to be as simple as possible.  You'll have by far the best experience using these versions:

  • .NET Framework 3.5 with SP1
  • Visual Studio 2008 (avoid Express editions)
  • IIS7 (Windows Vista, Windows Server 2008, Windows Seven, or Windows Server 2008 R2)

Configuration Files

Editing the configuration files will probably be the toughest part of this tutorial.  Take the time to fully examine all the XML so you understand what each node does.  Even if the error seems cryptic, it will probably at least point you to the part of the configuration that needs fixing.

Case Sensitivity

This one is for all you VB developers out there.  Take heed: these configuration files are case sensitive!

Security Errors

You shouldn't need to do this, but it can often help to run VS2008 as an Administrator to help rule out any security related problems.

Integrated Authentication

If you enable Integrated Authentication, you may receive this error:

Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

If so, you'll have to adjust your configuration files to match your IIS configuration.  For more information on this, see my post titled Using IIS and Windows Authentication to Secure WCF Services.

More Resources

Hopefully, you now have a basic understanding of how to at least get a really simple example running under WCF.  If you learn by experimenting, you should be away to the races.  If, however, you'd like to read a bit more about WCF before setting out on your own, here are some helpful pages you might not find on your own:

  • MSDN's introduction to WCF.  This should be your first point of reference.  The Getting Started Tutorial is a bit lengthy and complex for beginners, but it is very good reading for those who want to learn the 'Microsoft' way of doing WCF.  Highly recommended.
  • Nikola Dudar's Blog.  Here you'll find a similar approach to this article.  Based in C#, this tutorial focuses more on the VS2008 tools and features available to help you write WCF services.  It also introduces the WCF Service Host, a very helpful little utility.
  • If broken it is, fix it you should.  This is a C#-based introduction that goes into a little more depth on the code side of things.
  • Kirk Evan's Blog.  Here's a trick to invoke WCF services dynamically, which is very helpful if you don't have the metadata of the service you're calling available until runtime.
  • J.D. Meier's Blog.  This blog has a huge list of articles and videos to help you out with a variety of security-related topics.
  • All About Interop.  This site has a wealth of WCF-related information.  You'll find lots of details on connecting your application with others through WCF, as well as some great screencasts and guides.

2 comments:


Copyright © 2010 Paul Guenette and Matthew Sleno.