有没有一种很好的方式来对WCF服务中的数据类型和方法进行版本化?版本WCF服务的方法
像这样的东西,将版本1.0中的方法包括到版本4.5中会很好。
[ServiceContract()]
interface ITradeTrackingService
{
[OperationContract()]
[Version(1.0, 4.5)]
void PublishQuote(Quote quote);
}
和数据类型相似的东西。
然后我想在我的网址这样做:
server.com/ws/2.3/
然后在我的Global.asax的BeginRequest做这样的事情:
protected void Application_BeginRequest(object sender, EventArgs e)
{
Service.Version = someParsingOfUrl(); // return 2.3;
}
然后正确的方法暴露并且暴露了数据类型中的正确值。
这只是我在做梦,还是可以以某种方式完成?
[使用WCF版本化您的服务的最佳实践]的可能重复(http://stackoverflow.com/questions/36999/best-practices-for-versioning-your-services-with-wcf) – Cheeso 2012-04-26 01:57:17