rest - HttpContext in WCF -


i have written simple rest api in wcf, , authentication mechanism uses api key. once client submits api key in request header, check on server side (in baseservice class overriding processrequest() method of requestinterceptor class) follows:

public partial class baseservice : requestinterceptor {     public baseservice() : base(false) { }      #region process request     public override void processrequest(ref requestcontext requestcontext)     {         if (isvalidapikey(requestcontext))            //put values in httpcontext object.       } 

...

now have enabled aspnet compatibility in rest services, still cannot access httpcontext object in processrequest override above. note httpcontext accessible inside service method, not in processrequest method.

any ideas why?

the httpcontext initialized later in wcf channel stack. remember channel interceptor runs in channel stack before else, , after message has been received http channel listener. need access httpcontext request interceptor ?. http request available property in message associated requestcontext. can add store values in property bags available in message well.

thanks pablo.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -