サービスにインターフェイスを使用しています (TFS2010 と TFS2012 で同じ)
using System.ServiceModel;
using System.ServiceModel.Web;
namespace TFS_Event_Services
{
[ServiceContract(Namespace = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
public interface ITFS_Event_Services
{
[OperationContract(Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify")]
[XmlSerializerFormat(Style = OperationFormatStyle.Document)]
[WebInvoke(Method="Notify")]
void Notify(string eventXml, string tfsIdentityXml);
}
}
したがって、私の .svc は次のようになります。
namespace TFS_Event_Services
{
public class TFS_Event_Services_2012 : ITFS_Event_Services
{
public void Notify(string eventXml, string tfsIdentityXml)
{
//do something with the Event
}
}
}
.svc マークアップ:
<%@ ServiceHost Language="C#" Debug="true" Service="TFS_Event_Services.TFS_Event_Services_2012" CodeBehind="TFS_Event_Services_2012.svc.cs" %>
もちろん、Web サービスを作成した後、TFS アラート ソープ コールのターゲットである IIS に公開する必要があります。