Click here to Skip to main content
12,703,102 members (29,222 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


6 bookmarked

New Features in WCF 4.5 - Part 3

, 15 Apr 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
New features in WCF 4.5 - Part 3

In my previous posts on this topic, I have explained about the following new features in Windows Communication Foundation v 4.5:

Now, here in this WCF Tutorial, I'll discuss the following new and exciting features in WCF v4.5.

  • ASP.NET Compatibility Mode Default Changed
  • BasicHttpsBinding

WCF - ASP.NET Compatibility Mode Default Changed

While working with previous version of Windows Communication Foundation, if we wanted that our WCF request should be treated in the same way as an ASP.NET request, for example, if we wanted to get access to HttpContext, we need to do a couple of steps to enable this feature in WCF. Because, by default, call to a WCF service bypass ASP.NET pipeline as opposite to normal ASMX web services.

Following are the steps we do to enable it:

  1. In web.config, set aspNetCompatibilityEnabled to true.
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  2. Add AspNetCompatibilityRequirements attribute to WCF Service with AspNetCompatibilityRequirementsMode set to either Allowed or Required.
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class MyWCFService : IMyWCFService

In WCF 4.5, AspNetCompatibilityRequirementsAttribute is, by default, set to "Allowed". So, giving complete control to features in ASP.NET pipeline.

WCF - BasicHttpsBinding

As we have already discussed in earlier parts of this WCF 4.5 Tutorial series that v4.5 has simplified a lot of things for the developers. This new BasicHttpsBinding does the same for us.

BasicHttpBinding is available in Windows Communication Foundation since initial versions. The new BasicHttpsBinding is almost similar to BasicHttpBinding with the following two exceptions:

  • Default Security mode = Transport
  • Default Client Credential Type = None

So, earlier with BasicHttpBinding, declaring transport security based endpoint in WCF is as follows:

           <binding name="BindingConfig1">
                 <security mode="Transport" />
        <service name="MyWCFService">
             <endpoint address=""

But using WCF 4.5, the same above configuration is simplified as follows:

        <service name="MyWCFService">
              <endpoint address=""

Definitely, this cool feature simplifies configuration and increases WCF developer productivity.

Previous << New Features in WCF 4.5 - Part 2

Other Related Tutorials that Might Be of Interest


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Imran Abdul Ghani
Software Developer (Senior) Emaratech
United Arab Emirates United Arab Emirates
Imran Abdul Ghani has more than 10 years of experience in designing/developing enterprise level applications. He is Microsoft Certified Solution Developer for .NET(MCSD.NET) since 2005. You can reach his blogging at WCF Tutorials, Web Development, SharePoint for Dummies.

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170118.1 | Last Updated 15 Apr 2014
Article Copyright 2014 by Imran Abdul Ghani
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid