I'm trying to write a simple WCF Wrapper to load a SyndicationFeed as a client.
Contract
[ServiceContract]
public interface IFeedService
{
[OperationContract]
[WebGet(UriTemplate="")]
SyndicationFeed GetFeed();
}
Usage
using (var cf = new WebChannelFactory<IFeedService>(new Uri("http://channel9.msdn.com/Feeds/RSS")))
{
IFeedService s = cf.CreateChannel();
this.FeedItemsList.DataSource = s.GetFeed().Items;
}
Question The problem is that the service is appending the method name to the url (ie. the above url would call http://channel9.msdn.com/Feeds/RSS/GetFeed), and since I want this to be extended to any feed I don't always know the name of the feed. Is there an attribute or property that I can specify that will use the default endpoint address instead of appending a method name?
Update Adding the [WebGet(UriTemplate="")] only gets me part of the way there. It works for http://channel9.msdn.com/Feeds/RSS, changes it to http://channel9.msdn.com/Feeds/RSS/, but it doesn't work for other feeds like http://weblogs.asp.net/scottgu/atom.aspx which gets changed to http://weblogs.asp.net/scottgu/atom.aspx/