Khushboo Sharan at Microsoft has made a very basic sample for enabling continuous integration (more) with Team Foundation Server available here
The sample uses a standard .Net 2 .asmx webservice to listen to CheckIn Events from the server, with the service defined as follows:
[WebService(Namespace = "http://schemas.microsoft.com/Team[...]
Foundation/2005/06/Services/Notification/03")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class NotificationService : System.Web.Services.WebService
{
[SoapDocumentMethod(
"http://schemas.microsoft.com/TeamFoundation/2005/06/[...]
Services/Notification/03/Notify",
RequestNamespace =
"http://schemas.microsoft.com/TeamFoundation/[...]
2005/06/Services/Notification/03")]
[WebMethod]
public void Notify(string eventXml, string tfsIdentityXml)
// Do not change the names of these parameters
{
This works great with a webservice, but what about if you want to subscribe to the CheckIn event from a WCF host? Using the method signature defined above in your OperationContract silently fails.
After examining the XML received from the service, it was found that an extra element was being sent from the server. This means that the correct signature for receiving the CheckIn event within a WCF service is as follows:
[ServiceContract(Namespace = "http://schemas.microsoft.com[...]
/TeamFoundation/2005/06/Services/Notification/03")]
public interface ICheckInEvent
{
[ OperationContract(Action = "http://schemas.microsoft.com/[...]
TeamFoundation/2005/06/Services/Notification/03/Notify", Name = "Notify")]
void Notify(string eventXml, string tfsIdentityXml, SubscriptionInfo SubscriptionInfo);
}
Where SubscriptionInfo is a DataContract defined like this:
[DataContract(Namespace="http://schemas.microsoft.com/[...]
TeamFoundation/2005/06/Services/Notification/03")]
public class SubscriptionInfo
{
[DataMember()]
public string ID;
[DataMember()]
public string Subscriber;
[DataMember()]
public string Classification;
}
Finally we can use a WCF service to integrate with TFS!