October 2006 - Posts
In the past, I used Colin Coller's CopySourceAsHtml in Visual Studio.NET 2003. Once Visual Studio 2005 was released, Derick Baily and Jason Haley released a modified version and installer for it. I downloaded it and used it since. But it seems Colin has updated his version since june 11th.
I've just uploaded the first official release of CopySourceAsHtml for Microsoft Visual Studio 2005. This release has a leaner, meaner, refactored codebase that fixes a few minor defects and takes advantage of new features in Visual Studio 2005 and .NET 2.0. This will be the codebase that future releases will be built from.
Download it here.
As seen in the previous article, we need an address, binding and contract to complete the WCF ABC. We'll start at the contract.
A contract is defined explicitly, via a class. You add a [ServiceContract] attribute to the class. All methods you want to expose in your service, you mark as [OperationContract], as methods are called operations in services.
public class Hello
return "Hello world";
return "Hello computer";
The operations are defined explicitly, a Service Orientation tenet. HelloComputer won't be visible by consumers of our service; it isn't marked with an attribute. The HelloWorld operation however is, even though it's private inside the .NET World.
We prefer however, to have an interface for our contract and have our actual service implement the interface. That's because
- Interfaces can extend/inherit other interfaces
- A single class can implement multiple interfaces
- You can modify the implementation of a service without breaking the contract
- You can version your service via old and new interfaces
It's always best to have an interface and implement it. The attributes also must be specified in the interface.
public interface IHello
public class Hello : IHello
return "Hello world";
return "Hello computer";
In the next article I'll show you how you can host this service. In the future we'll also consume the service and I will try to tell more about contracts and versioning.
[Go to the WCF series article index]
I'm currently using Omea Reader by Jetbrains for all my RSS subscriptions. But after re-installing my laptop and installing the latest Omea Reader, some weird indexing bug occured. The bug is fixed in version 2.2, which is still beta, but can be downloaded here. Unfortunatly the link is broken. I've sent emails to about 8 departments inside JetBrains, but only some nice lady called Daniela Vokalova from sales replied that she'd forward the mail.
But since Internet Explorer 7 has built in RSS Support, I'd thought I'd give it a try. First things that I've noticed:
- I can't import OPML files/feeds
- A weird feed subscription without items was suddenly inserted without a name or any items. I can't delete it, and when I try to rename it, I can't submit the new name. The input-field stays.
So I booted Outlook 2007 again and was notified that I could merge Outlook and IE7 RSS Feeds. I did and decided to check out the RSS functionality in Outlook. Great, it provides OPML imports. Unfortunatly only in the root, so I had to move every BloggingAbout.NET weblog into a new folder.
As every weblog was newly inserted, all items were unread. I right-clicked the folder I had moved all weblogs in, selected "mark all as read", and nothing happened. You have to right-click every feed seperatly. You can't ctrl- or shift-select mutliple feeds.
So I hope JetBrains soon fixes the link, because I think I'll stick to Omea Reader.
I've received mail from JetBrains that the link is fixed and an even newer version was uploaded. My weird indexing bug is now gone and I'm a very happy Omea Reader user again! Download the EAP here.
I want to begin with a conceptual explanation about services. A service always has at least one endpoint, but can have multiple. A client normally communicates with only one endpoint. A plain-old-webservice only has one endpoint and communicates via HTTP and Text/XML. The picture below shows a service with three endpoints. Notice the ABC.
There are a few articles about the WCF ABC's (1, 2)but the short story is that you always have to remember:
- A stands for Address
- B stands for Binding
- C stands for Contract
I'll try to explain them, they'll get more sense once we advanced in posts.
Every website and webservice has an address, like http://bloggingabout.net/ or http://mydomain.com/stockquote.asmx. Our WCF services also must have an address. WCF can provided addresses for the following protocols:
A binding specifies how a service is accessible. Think transport protocol (see the previous list that shows the basic list), encoding (text, binary, etc) and WS-* protocols like transactional support or reliable messaging.
The contract is something you completely specify by yourself. The contract is used to specify what your service can do. For example give you the correct streetname and city when providing a zipcode.
In the next articles I'll explain how you can build a service while using the ABC.
[Go to the WCF series article index]
I'm starting a series of posts about Windows Communication Foundation (WCF). The goal of the series is to introduce WCF to everyone who hasn't had the opportunity to experience WCF, for whatever reason. While other articles sometimes are too long, I want to keep them very short. That way you're able to read them before your workday begins or perhaps just before you shut down. :-)
From every post I'll refer to this post and I'll keep an index here so you can easily find your way.
... more to come?
Other WCF tutorial articles
Yesterday was a great day for our family, as my son 'Bart' was born at 17:12. With 3650 grams and 53cm long, pretty tall for our standards. My wife and kid are great and just came home this morning. My other two daughters, Naomi and Emma still have to get used to him, although they've already given him a small kiss, very carefully. Here's a picture of our youngest member.
Logik! was the one who started with a wish list for Community Server 3.0. I don't know if others have picked this up, but I have some wishes for myself. Let's see:
- Skinnable root pages
I'm not sure if the new theme engine will support this, but I sure hope so. Currently I have two sites running on top of a single CS install. When I adjust anything in the .aspx page(s) of one site, the other automatically changes as well. I'd like to have the ability to create a different look & feel for both sites.
- Better support for installing & configuring addons
I absolutely love the current support. The fact that you can add addons without altering the code is fabulous! But it can still be a hasle to install them properly. I'm not really sure how 'better support' for addons can be achieved. One idea I've been having however, is...
- Config file merging
Almost every addon requires some text to be merged with some config file. Be it configuration or some navigation-bar features. What really would be cool is if we had a tool to do this. And not just merging of modules, but also enabling and/or uninstalling of the added configuration parts. Additional (comment)tags probably have to be added so the tool would know where to begin and end uninstalltion of a certain mod, but it probably could be done. Publishers of addons would just have to provide one or more files with content to be merged.
A quicker solution however could be when Telligent releases some templates that publishers of addons could use to create a nice installation & uninstallation guide that conforms to Telligent guidelines.
- CardSpaces integration
Since I've heard that this will be included in Community Server, I can't wait for it to be here! I hope CardSpaces (formerly InfoCard) will be supported by a lot of websites, because I really hate to have many usernames & passwords. Also the fact that one account can be shared over multiple communities (on the same CS installation) is a great addition I'm looking forward to.
Perhaps the ability to flush the cache for a single weblog (or something simular) would be nice. I was using Windows Live Writer recently and accidentally published the post. I went to this site immediatly and deleted it. But after a few minutes it was still showing up in the RSS Feed. Perhaps clearing the cache after an action (insert, update & delete) on the posts would be nice.
- Rating articles only with comments
Currently I always give my own articles 5 stars, because everything I write is just that good. :) But perhaps it's a good idea to force people to write a comment, to be able to rate an article. That way you'll know how many people have voted, and why they voted. When people fill in a comment, they can also instantly rate your article. That way you might get more ratings. It should be optional though, so people can also rate articles without adding comments. Not per weblog, but per site, so rating on individual posts/weblogs is still fair.
That's about what I can think of. I already can't wait for Community Server 3.0.
I was browsing Google, got an MSDN link, clicked it, and got the folloing error.
Strange though that CustomErrors are turned. Perhaps someone's fixing it from a remote location and turned if off to view the error himself! ;)
Anko, my employer and colleague, became official Regional Directory today. The idea is to 'evangelize' .NET and other Microsoft technologies. I'm not sure what Microsoft and .NET have to do with the Bible, but as evangelist literally means 'bringer of good news', that's probably what Anko does. :-)