notgartner.com: Mitch Denny's Blog
Life,
family, technology and stuff!

Get This Blog via Email:

Powered by Squeet.com

My Links

Home

Readify

Google

Contact

Syndication

Associations

Blog Stats

Posts - 1124

Stories - 0

Comments - 1312

Trackbacks - 482

Archives

July, 2006 (8)

June, 2006 (31)

May, 2006 (32)

April, 2006 (40)

March, 2006 (35)

February, 2006 (54)

January, 2006 (47)

November, 2005 (29)

October, 2005 (51)

September, 2005 (31)

August, 2005 (60)

July, 2005 (61)

June, 2005 (40)

May, 2005 (55)

April, 2005 (51)

March, 2005 (29)

February, 2005 (46)

January, 2005 (60)

December, 2004 (59)

November, 2004 (37)

October, 2004 (40)

September, 2004 (37)

August, 2004 (49)

July, 2004 (31)

June, 2004 (31)

May, 2004 (15)

April, 2004 (22)

March, 2004 (23)

February, 2004 (15)

January, 2004 (2)

December, 2003 (2)

November, 2003 (1)

Post Categories

Avalon

Blogging

Boonie

C#

Code

Community

Cricket

csUnit

Digital Media

Events

Food

FUD

Humour

IBM

Indigo

INETA

IoC

Longhorn

Microsoft

Mobility

MVP Program

NAnt

NUnit

Orcas

Personal

Podcasting

Pointless

Press

Project Management

Shrinklet

Software Engineering

Sport

SQL Server

Travel

Usability

Utilities

Weather

Whidbey

Windows Forms

Windows Mobile

WinFS

Wishlist

Work

WSE/Web Services

Image Galleries

Cool Snaps

Diagrams

Family

Friends

Funnies

Gadgets

Photoshop

Screenshots

TAOBAM

.NET Community

.NET Rocks!

Adelaide Dot Net Users Group

ASP.NET

AspAdvice

ASPalliance

ASPInsiders

Canberra .NET User Group

Gold Coast .NET SIG

GotDotNet

International .NET Association

Melbourne .NET User Group

MSDN Update
(Australia)

Newcastle .NET User Group

Orkut

Queensland MSDN User's Group

Sydney .NET Users
Group

Sydney Deep .NET User Group

The Australian Developers.NETwork

Wollongong .NET Users Group

.NET Tools

NAnt

NAntContrib

NHashcash

NProf

NUnit

Blogroll

John Bristowe

Rob Howard

Scott Guthrie

Susan Warren

Developer Resources

Distractions

Addicting Games

CollegeMix Games

FlashGames247

Flying Pig Game

Guess-the-Google

rathergood.com

Smashing Games

Squares 2

The Meatrix

Yeti Sports

Morning Ritual

ACTION Buses

Weather
Radar

My Projects

NHashcash

Shrinklet

Readify Bloggers

Bill Chesnut

Chris Hewitt

Dan Green

Darren Neimke

Grant Holliday

Greg Low

Joseph Cooney

Kim Peacocke

Luke Drumm

Martin Granell

Scott Baldwin

Login

Username:

Password:

Remember Me

How To: Listen for Team Foundation
Server (TFS) Event Notifications using Windows Communication Foundation
(WCF)

I feel that this post requires musical accompaniment.
Internally at Readify we have been looking at ways that we can extend our Team
Foundation Server environment. One of the key ways you can do this is write code
that subcribes to and listens for event notifications so that when things like
check-ins or builds occur, you can respond.

The process for implementing event listening services typically involves
going and downloading
Howard
van Rooijen's pre-baked TFS Notification Web Services template, implementing
your specific logic and deploying them to a box.

One of the issues that I have with Howard's templates is that they are
implementing using the new web-site project type as opposed to the even newer
(but more reliable) Web Application
Project template types, but on top of that I just don't like the hassle of
having to deploy a web-site and much around with IIS configuration settings
(even once) to get the listener working, and that is before we even get to
dealing with state management and constantly cycling application pools.

Enter Windows Communication Foundation

If something bothers me I like to do something about it, and this IIS
configuration dependency was definately bothering me so I decided that I would
attempt to host an event subscriber notification service inside WCF as a bit of
a demonstration (I'll probably expand on this a little in my presentation at
TechEd 2006 in Sydney).

I wanted the demonstration to do two things, firstly I wanted it to
automatically subscribe itself to the TFS event notification services when it
started up and clean itself up when it shuts down, but also the specific tweaks
that are required to the service endpoint documentation in the Visual Studio
2005 SDK. You can download the demo code
from here, but the real active ingredient is the implementation of the WCF
service.

[ServiceContract(
Namespace = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
public interface INotificationService
{
[OperationContract(
Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify",
ReplyAction = "*")]
[XmlSerializerFormat(Style = OperationFormatStyle.Document)] /* Took me hours to figure this out! */
void Notify(string eventXml, string tfsIdentityXml);
}

public class NotificationServiceImpl : INotificationService
{
public void Notify(string eventXml, string tfsIdentityXml)
{
Console.WriteLine(eventXml);
}
}

So why the musical accompanyment? Well, it took me hours to figure out the
reason the Notify method was silently failing to be executed was because I
hadn't specified that I wanted it to use document style encoding for the
operation – "we are the champions" is the tune I had playing in my head when I
finally got it working and was running around the house cheering like a soccer
player that had just won the World Cup!

posted on Tuesday, July 04, 2006 2:26 PM

Comments

# re: How To: Listen for Team Foundation Server (TFS) Event
Notifications using Windows Communication Foundation (WCF)

Howard van
Rooijen

Fantastic! I'd totally overlooked implementing a Web
Application Project template - will do that for version 1.2

Posted @ 7/4/2006 4:37 PM

# I
bookmark del giorno #43 - VSTS Edition

http://blogs.ugidotnet.org/lbarbieri/archive/2006/07/04/44019.aspx

Posted @ 7/4/2006 6:17 PM

# re: How To: Listen for Team Foundation Server (TFS) Event
Notifications using Windows Communication Foundation (WCF)

Eddie de Bear

lol, I love nothing better than solving a tricky
problem and running around.. I normally run around shouting "I am a legend" or
"I rock".. The problem I found is that nobody else seems to share my
joy...

Posted @ 7/5/2006 5:45 AM

# Using WCF to Listen for Team Foundation Server Event Notifications

Rob Caron

Mitch Denny blogs&nbsp;how to listen for Team
Foundation Server (TFS) event notifications using Windows...

Posted @ 7/5/2006 6:12 AM

Post a comment

Title
Please enter a title

Name
Please enter your name

Url

Comments

Please enter a comment

Remember Me

Powered by:

Copyright © Mitch Denny