gpt4 book ai didi

asp.net - 启用 Silverlight 的服务和 ASP.NET 兼容性

转载 作者:行者123 更新时间:2023-12-04 06:59:43 24 4
gpt4 key购买 nike

创建启用 Silverlight 的 WCF 服务时,源文件中放置以下行 -

[AspNetCompatibilityRequirements(RequirementsMode =
AspNetCompatibilityRequirementsMode.Allowed)]

它有什么作用?在线帮助对我来说没有多大意义。

最佳答案

在兼容模式下,WCF 服务通过 IHttpHandler 实现使用 HTTP 管道,类似于处理 ASPX 页面和 ASMX Web 服务请求的方式。因此,WCF 在以下 ASP.NET 功能方面的行为与 ASMX 相同:

* HttpContext: WCF services running in ASP.NET Compatibility Mode can access Current and its associated state.

* File-based authorization: WCF services running in ASP.NET compatibility mode can be secure by attaching file system access control lists (ACLs) to the service’s .svc file.

* Configurable URL authorization: ASP.NET’s URL authorization rules are enforced for WCF requests when the WCF service is running in ASP.NET Compatibility Mode.

* HttpModuleCollection extensibility: Because WCF services running in ASP.NET Compatibility Mode participate fully in the ASP.NET HTTP request lifecycle, any HTTP module configured in the HTTP pipeline is able to operate on WCF requests both before and after service invocation.

* ASP.NET Impersonation: WCF services run using the current identity of the ASP.NET impersonated thread, which may be different than the IIS process identity if ASP.NET impersonation has been enabled for the application. If ASP.NET impersonation and WCF impersonation are both enabled for a particular service operation, the service implementation ultimately runs using the identity obtained from WCF.

关于asp.net - 启用 Silverlight 的服务和 ASP.NET 兼容性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2069012/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com