![](/img/trans.png)
[英]c# WCF REST strongly typed WebGet object for parameters and validation
[英]Any ideas on a WCF Interceptor for a REST WebGet request to change the Url/Querystring parameters
有谁知道我可以在WCF内拦截REST Get请求的方法,例如,我可以更改任何querystring参数的值。 因此,在返回将用于继续处理请求的值之前,我需要先运行一些代码,然后再WCF评估WebGet属性的UriTemplate并能够对其进行编辑。
任何帮助将不胜感激
安德鲁
这个小片段向您展示了如何更改/更改网址:
/// <summary>
/// Interface for communicating with twitter.com.
/// </summary>
[ServiceContract]
public interface ITwitterClient
{
[OperationContract]
[WebGet(UriTemplate = "statuses/user_timeline/{twitterName}.xml?count={numberOfTweets}",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml)]
Statuses PublicTimeline(string twitterName, int numberOfTweets);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.