Receiving Team Foundation Events - Correction

Published 15 July 05 09:31 AM | psheill 

The documentation for Visual Studio beta 2 gives the following example for receiving TFS events (work item change, checkin, build completed, etc.).

[SoapDocumentMethod(Action = "http://Microsoft.VisualStudio.Bis/Notify")]
[WebMethod]
public void Notify(string bisEvent)
{
  ...
}
In fact it should be:

[SoapDocumentMethod(Action = "http://Microsoft.VisualStudio.Bis/Notify", 
RequestNamespace = "http://Microsoft.VisualStudio.Bis")]
[WebMethod]
public void Notify(string eventXml)
{ 
  ...
} 

Note that the parameter name must be "eventXml" exactly, since webmethods depend on reflection to match SOAP arguments with methods. Post beta 2, it will be slightly different still:

[SoapDocumentMethod(Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/02/Notify" , 
   RequestNamespace="http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/02"
)]
[WebMethod]
public void Notify(string eventXml) 
{
  ...
}

If you don't have the attributes or the parameter name correct, you are likely to see the strange behavior of the method being called, but the parameter being null.

Comments

# Team System News said on July 19, 2005 5:25 PM:
Dave Bost - Directory Permissions For Team Foundation Build

Dave explains some things you need to...
# Receiving Team Foundation Events - Correction said on November 25, 2007 9:18 PM:

PingBack from http://feeds.maxblog.eu/item_855278.html

New Comments to this post are disabled

Search

This Blog

Syndication

Page view tracker