Sdk tfs addWorkItemSaveListener未获取事件

Sdk tfs addWorkItemSaveListener未获取事件,sdk,tfs,Sdk,Tfs,我正在添加一个TFS WorkItemSaveListener,但没有获得任何关于保存workitem的事件 public static void main(String[] args) { // Connecting to Project final TFSTeamProjectCollection collection = ConsoleSettings.connectToTFS(); // Creating an object of lis

我正在添加一个TFS WorkItemSaveListener,但没有获得任何关于保存workitem的事件

public static void main(String[] args) {
        // Connecting to Project
        final TFSTeamProjectCollection collection = ConsoleSettings.connectToTFS();

        // Creating an object of listener
        WorkItemSaveListenerImpl listener = new WorkItemSaveListenerImpl();

        //Adding the listener
        collection.getWorkItemClient().getEventEngine().addWorkItemSaveListener(listener);

        for(;;) {
            // keeping the program alive
            try {

                Thread.sleep(10000);
            }
            catch (InterruptedException exception) {
                // TODO Auto-generated catch block
                exception.printStackTrace();
            }
        } 


    }

这里我只是在猜测,因为我不知道java sdk。但是,addWorkItemSaveListener事件是否可能仅针对由特定工作项客户端更改的工作项触发

您可能需要设置soap订阅,或者编写服务器插件

C#设置soap订阅

抱歉,这是为错误的事件,但它可能足以给你一个想法

TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(txtServerUrl.Text));
tpc.EnsureAuthenticated();
IEventService eventSrv = tpc.GetService(typeof(IEventService)) as IEventService;
DeliveryPreference delPref = new DeliveryPreference();
delPref.Address = "http://" + System.Environment.MachineName + ":8001/CheckInNotify";
delPref.Schedule = DeliverySchedule.Immediate;
delPref.Type = DeliveryType.Soap;
subscriptionId = eventSrv.SubscribeEvent(System.Environment.UserDomainName + "\\" +     System.Environment.UserName, "CheckInNotify", "", delPref);