Access HttpContext inside WCF RequestInterceptor ProcessRequest method

I have create a WCF service using the WCF REST stater kit. I am using a RequestInterceptor to do authentication(API Key validation).Inside of the RequestInterceptor(ProcessRequest method) I want to get access to the HttpContext of the request.I have to store several things in the HttpContext. Can somebody help me how to access the HttpContext inside RequestInterceptor. Although Httpcontext is accessible under service.


这可能会有所帮助,你不会得到HttpContext,但你可以得到标题和其他方面,将获得相同的数据。

   var prop = (HttpRequestMessageProperty)requestContext.RequestMessage.Properties[HttpRequestMessageProperty.Name];
            var queryString = requestContext.RequestMessage.Headers.To.AbsolutePath;
            var authAccessToken = prop.Headers["Authorization"];
链接地址: http://www.djcxy.com/p/26896.html

上一篇: 从WCF Web服务访问HttpContext.Current

下一篇: 在WCF RequestInterceptor ProcessRequest方法内部访问HttpContext