【发布时间】:2010-10-01 10:27:39
【问题描述】:
我有一些 RESTful 服务在纯 WCF 上下文中运行(即未启用 ASP.NET 兼容性,因此没有可用的 HttpContext.Current 对象)。
服务的 URL 在请求开始时使用 IHttpModule 重写(此时确实有 HttpContext 并使用 HttpContext.Current.RewritePath 重写它)以摆脱像 .svc 这样的东西URL 的扩展名。
但是,我需要访问从 WCF 基础结构中请求的原始 URL。在任何地方的OperationContext 或WebOperationContext 类上是否有等效于HttpContext.Current.Request.RawUrl 的内容?使用WebOperationContext.Current.IncomingRequest.UriTemplateMatch.RequestUri 会返回重写后的 URL,而不是原始 URL。
【问题讨论】:
标签: wcf url-rewriting httpcontext operationcontext weboperationcontext