In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about how to understand the compatibility of WCF services and ASMX services in ASP.NET. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.
As you know from the previous operation, when you create a new WCF service for an asp.net AJAX program, the service class is decorated with the AspNetCompatibilityRequirements attribute by default. Now, let's make a brief analysis.
Analysis of WCF service and ASMX service in ASP.NET:
[ServiceContract] [AspNetCompatibilityRequirements (RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)] public class TimeService {. }
Although designed for independent transport, WCF services can actually work in a way that is very similar to ASMX services when applied in an asp.net AJAX application environment. With this AspNetCompatibilityRequirements attribute, we can instruct WCF to work using the same model as the ASMX service. In practice, this setting indicates that when a WCF service is activated, the runtime checks the declared endpoints and ensures that they all use the Web HTTP binding model.
Good compatibility with ASMX services makes it possible to access asp.net objects such as HttpContext objects and other inherent asp.net objects in WCF services.
Note that there are at least two things you need to achieve compatibility between WCF services and ASMX services in ASP.NET. In the configuration file web.config, you need a declarative definition similar to the following:
< system.serviceModel>:
< serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> < /system.serviceModel>Second, developers need to explicitly choose the compatibility mode of a given WCF service, which is done by using the service AspNetCompatibilityRequirements property.
The service requirements requested in the asp.net AJAX application must be configured on the server side accordingly. To sum up, in asp.net applications, there are two main software technologies that can be used to build services, namely ASMX Web services and WCF services. Among them, WCF service already includes ASMX Web service. However, it must be clear that AJAX communication requires the use of JSON data strings to transfer data back and forth between the client and the server. It is an easy task in the era of asp.net AJAX extension 1.0 or in asp.net 3.5 to adjust the asp.net runtime so that ASMX Web services support JSON. However, it is slightly more complicated to implement the transmission of JSON data format for richer WCF services. This is why WCF can be used to build AJAX back-end services only in asp.net 3.5.
The above is the editor to share with you how to understand the compatibility of WCF services and ASMX services in ASP.NET. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.