我使用的接口为我服务(同为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" %>
创建你的网络服务后,你需要发布它的一些IIS是TF的目标S警报肥皂电话,当然。
我会尝试并告诉你! *(星期四)*。你有我的+1 =) – apacay 2013-04-30 20:55:41