mardi 4 mai 2010

My WCF application is not called by TFS 2010 Event Service

For TFS 2010 be able to contact your WCF you have to use the WSHttpBinding and you have to specify a bindingConfiguration that disable the security. You can see below what I use for mine.

I hope that will help someone (at least Nicolas M).


ITfsEventSubscriber.cs :


...
[ServiceContract(Namespace = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
public interface ITfsEventSubscriber
{
    [OperationContract(Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify")]
    void Notify(String eventXml, String tfsIdentityXml);
}
...



TfsEventSubscriber.cs :

...
public class TfsEventSubscriber : ITfsEventSubscriber
{
    void ITfsEventSubscriber.Notify(String eventXml, String tfsIdentityXml)
    {
        // My notify code
    }
}
...



Web.config :


...
<system.serviceModel>
    <bindings>
     <wsHttpBinding>
        <binding name="NoSecurity">
         <security mode="None">
         </security>
        </binding>
     </wsHttpBinding>
    </bindings>
    
    <services>
     <service behaviorConfiguration="WcfTfsDeployer.Behavior" name="WcfTfsDeployer.TfsEventSubscriber">
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="NoSecurity" contract="WcfTfsDeployer.ITfsEventSubscriber" />
     </service>
    
    </services>

    <behaviors>
     <serviceBehaviors>
        <behavior name="WcfTfsDeployer.Behavior">
         <serviceMetadata httpGetEnabled="true"/>
         <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
     </serviceBehaviors>
    </behaviors>
</system.serviceModel>



...

lundi 3 mai 2010

What's new with BisSubscribe in TFS 2010

Hi all,

We currently migrating our Team Foundation Server 2008 to TFS 2010 and have some little issues, so I found a solution around BisSubscribe.exe that I want to share with all.

I tried to subscribe our WCF service that intercept the build quality change event to deploy our web sites on diffrent severs. But with using the BisSubscribe.exe syntax I knew with TFS 2008 it's failed with this message :


....
Exception Message: Event type BuildStatusChangeEvent does not exist. (type TeamFoundationServiceException)
...



With TFS 2008 a subscription looked like :

bissubscribe /eventType BuildStatusChangeEvent /address http://myWebServer/MyService/myNotificationService.asmx /deliveryType Soap /server http://tfsserver:8080


For TFS 2010 due to the Team Project Collection the url of the parameter /server is not functionnal and you have to use /collection instead, like this sample :

C:\Program Files\Microsoft Team Foundation Server 2010\Tools>BisSubscribe.exe /eventType BuildStatusChangeEvent /address http://myWebServer/MyService/myNotificationService.asmx /deliveryType Soap /collection http://tfsServer:8080/tfs/MyCollection


Where MyCollection is the Team Project Collection where you want to subscribe. It's appear the /server doesn't work well with all events (like BuildStatusChangeEvent).

I hope that could help someone !