I was curious how anyone would go about creating WCF based services using a dynamic language like IronPython or IronRuby. These languages do not have the concept of interfaces. How would someone define service contracts? Would we need to rely on static languages for such kind of tasks? I am a big fan of Python in particular and would like to know if this can be done at this point.
IronPython has a new feature in 2.6 to create normal .NET classes using the Python class definition machinery. The new feature is enabled by overriding clrtype on a metaclass. You can then declare a class with a bunch of decorators and the metaclass creates a new .NET type. As a sample we have the set of metaclasses which can be used (or customized) over on the IronPython CodePlex site for the 2.6.1 release.
I haven't tried it w/ WCF in particular but it does work in other cases when you need to use a static type. There are some cases where it won't work - particularly if the framework needs to do Type.GetType(typeName).
I have done some experiments - see my experiences on my blog.
The good news is WCF service can be fully written in IronPython. The bad news is such WCF service does not work in IIS because you cannot use compiled IronPython code from C# or VB directly.