2013-04-30 30 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