Omada
Omada

Reputation: 784

Team Foundation: Web Service is Called Multiple Times

I am running a Web Forms site in Visual Studio, and I built a WCF web service following this to hook up to the "Build Quality Changed" and "Build Finished" alerts of Team Foundation.

The service works fine, the only problem is that it is called more than once by Team Foundation. As in I change the build quality and the service gets called. Cool. Then about 10-15 minutes later, the service gets called again on every event that has so far been called in. For example:

  1. I run build1 - service gets called when it finishes. 15 minutes later it gets called again for build1.
  2. I run build2 - service gets called for build2. 15 minutes later it gets called again for build1 and build2 both. It accumulates.

So far I have only tried this inside the Visual Studio debugger. And I have confirmed that if I call the Web Service manually, it does not accumulate. I have no clue why this is happening. I might be able to get around it by checking the times that builds were finished, but I would really prefer that this doesn't happen at all.

Also, I'm using .NET 4.5, Visual Studio 2012, Team Foundation 2012

Thank you!

Upvotes: 1

Views: 207

Answers (1)

Omada
Omada

Reputation: 784

So I finally figured out what was going on. I just needed to remove the IsOneWay=true from my contract:

[OperationContract(Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify"
                   IsOneWay=true)]

With IsOneWay on, Team Foundation was never getting a response back from the service, so it could not confirm that it had succeeded. So every 15 minutes it retried up to a maximum of 5 times. For some reason the retries for any previous alerts are all scheduled at exactly the same time, so it looks like it is accumulating.

Upvotes: 1

Related Questions