2013-04-30 70 views
0

我似乎无法找到如何连接到TFS EventService SOAP,我想我应该创建一个服务,通过TFS将其作为参数与TFS调用与...一起工作...如何在简单的步骤中用SOAP连接到TFS EventService

但我在网上找不到那样的东西。

我唯一发现的是这样的:http://msdn.microsoft.com/en-us/magazine/cc507647.aspx 这看起来很旧并且不推荐使用。

我正在使用tfs2012和vs2012。

@编辑:这个想法是连接到WorkItemStatusChange和CheckIn事件。

回答

2

我使用的接口为我服务(同为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警报肥皂电话,当然。

+0

我会尝试并告诉你! *(星期四)*。你有我的+1 =) – apacay 2013-04-30 20:55:41