简体   繁体   中英

Get HttpContext.Current with aspNetCompatibilityEnabled=“false” in wcf service

My website is completely HTTPS. So I want to call the WCFService in HTTPS protocol but Microsoft says with aspNetCompatibilityEnabled="true" we can not use non-http bindings, may be that is why I am getting ServiceActionException. When I make aspNetCompatibilityEnabled="false" WCF service is working fine HTTPS. But the value of HttpContext.Current is null .

So how can I get the HttpContext.Current value with HTTPS binding?

I am following this link

Can anyone help please?

for HttpContext.Current to be a non-null value you have to have aspNetCompatibility set to true or allowed. You can access the message headers via WebOperationContext.Current.IncomingRequest.Headers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM