Reprint to: http://www.cnblogs.com/liulun/archive/2012/02/12/2347956.html
Original article address:
Http://www.infoq.com/news/2012/02/WCF-4.5
Ido Flatow posted some blogs to describe how to update WCF in. net4.5.
Link address:
Http://blogs.microsoft.co.il/blogs/idof/archive/2011/10/05/what-s-new-in-wcf-4-5-automatic-https-endpoint-for-iis.aspx
(If you have time, I will translate them one after another)
For the purpose of reducing complexity, the configuration file automatically generated by WCF will become very, very small. Since the first version of WCF, developers have found that they need to maintain an app. config file with about 30 configuration sections, which can be replaced by default values. Everyone knows that it is better to delete these redundant settings, but unfortunately, no one has learned this trick! In the configuration file of WCF 4.5, you only need to set the bound type and name!
Of course this leads to another problem: "How do I know what these settings are ?" To answer this question, we must knowCode(Code related to configuration information), and the prompt of the configuration file is not a schema-based smart prompt. If you are editing an endpoint, you need to know the name of a behavior. At this time, the development tool will list all the available behavior names. Some configuration file errors during compilation, such as contract type behavior name errors, will be prompted.
There is also good news for developers who directly use WSDL. WCF 4.5 returns a complete WSDL in a separate request. Before that, only a part of the WSDL will be included, which requires a series of XSD files to match the WSDL. Use? Replace the singlewsdl query string? Singlewsdl can use this improvement
It is completely feasible to host the WCF Service to the system service. However, most developers continue to do a lot of work in IIS. Why? Because IIS provides many built-in support functions, such as identity authentication, status management, and process recycling. However, there are still some restrictions on developing the WCF Service under IIS, and Microsoft is also solving these problems. For example, the identity authentication service must be configured in two places. If they are not synchronized due to exceptions, the WCF Service will stop running. Wcf4.5 removes this type of bug by allowing the Service to perform identity authentication in IIS mode (set the identity authentication method to "inherit from the host inheritedfromhost ")
Unfortunately, this is only a local fix. If IIS activates multiple authentication types, the client will only know the first one. Of course, the client developers will find another way to solve this problem: they can use another type to override this authentication type.
When constructing a Uris object for https-based services, a bug is displayed in the WSDL information. in net 4, WCF has the feature of Automatically Selecting ports (for various types of binding, TCP, HTTP, etc.). Unfortunately, https is not included yet. In. net4.5, these negligence will be corrected. Ido Flatow believes that the HTTPS version advertises the host name rather than accessing the Host Name (host name) of the WSDL, which may be a problem when using web form.
Another bug is about using WCF to transmit stream data. Ido Flatow:
When you host the WCF Service on IIS, even if you do not use the Asp.net compatibility mode, you will also get part of the Asp.net processing pipeline. You can find the relevant content in the msdn document: WCF Service and ASP. NET (search for the postauthenticaterequest event section. In. Net 4, ASP. NET has a design defect. Requests to WCF are buffered in ASP. NET. These buffering behaviors may cause some side effects.
This not only results in request processing latency, But more seriously, a large part of the content overflows into the hard disk.
This problem is solved in WCF 4.5.