I apologize it has taken so long for me to post this, but as promised, here is the .cs file for the wsdl flattener.
FlatWSDL.cs (10.75 kb)
To use it, you need to modify your web config and add a reference to the library in the behavior extensions section: More...
I've recently begun learning Ruby by working my way through the Ruby Koans. I finally made it to the section on error handling, which answered a few questions for me.
Once again, Ruby has not surprised me (this is a good thing). There's just some minor syntactical differences. Specifically in place of "try, catch, finally" Ruby uses "begin, rescue, ensure".
rescue StandardError => ex
#Do something with the error
result = :code_that_always_runs
Since I haven't made it all the way through the koans yet I'm, probably missing something that seems obvious to long time Ruby users, but so far it's pretty damned simple.
Behaviors in WCF are so stinking useful, and once you get past the basics of WCF they're arguably a necessity. Microsoft has saved itself from hundreds of hours of cursing by including the ability to define custom behaviors.
My favorite use of behaviors is addressing some cross cutting concerns that we consistently have in our WCF services. Specifically logging, service registration, wsdl tweaking, and error handling. Which brings us around to the IErrorHandler interface.
If you've done any work with WCF and non .NET clients, you've probably had the need to make WCF emit a flattened WSDL that doesn't use xsd includes. You've probably run across Tomas Restrepo's InlineXSDInWSDLBehavior and Christian Weyer's FlatWSDL extension. They both work quite well. Possibly too well.