您可以在不启用 aspNetCompatibility 的情况下将数据从 HttpModule 传递到 IIS 托管的 WCF
我目前有一个 HttpModule,它为每个外部客户端请求生成一个唯一的 ID,将其附加到 IIS 日志,并将其添加到 HttpContext.Items 集合中,以便传递到 thw Web 服务。
我目前正在用 WCF 服务替换 Web 服务(仍然托管在 IIS 下)。我可以通过启用 AspNet 兼容性成功地完成相同的过程,但我不想这样做。有没有办法在不启用 AspNet 兼容性的情况下从 HttpModule 传递数据来表示 WCF 服务的 OperationContext?
I currently have a HttpModule that generates a unique ID per external client request, appends it to the IIS log, and adds it to the HttpContext.Items collection in order to pass in on the thw web service.
I am currently replacing the web service with a WCF service (still hosted under IIS). I can successfully do the same process by enabling AspNet compatibility, but I would prefer not to. Is there any way to pass data from a HttpModule to say the OperationContext of the WCF service without enabling AspNet compatibility?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MSDN 是这么说的,
HttpModule 可扩展性:当引发 PostAuthenticateRequest 事件时,WCF 托管基础结构会拦截 WCF 请求,并且不会将处理返回到 ASP.NET HTTP 管道。编码为在管道后期拦截请求的模块不会拦截 WCF 请求。
我建议您完整地阅读此 MSDN 文档来了解 ASP.Net和WCF共存
This is what MSDN has to say,
HttpModule extensibility: The WCF hosting infrastructure intercepts WCF requests when the PostAuthenticateRequest event is raised and does not return processing to the ASP.NET HTTP pipeline. Modules that are coded to intercept requests at later stages of the pipeline do not intercept WCF requests.
I suggest you go through this MSDN documentation completely to understand how ASP.Net and WCF coexist