Windows Communication Foundation v 4.5 released with lots of new features and we have already highlighted those features in previous WCF Tutorial. Now, we wanted to dive deeper and explore each new feature in more detail. Here in this WCF Tutorial – Part 1, we are going to discuss the following two new features in more details:
- Simplified Generated Config Files
- Validating WCF Configuration
WCF – Simplified Generated Config Files
If you ever workedwithprevious versionsofWCF,youmust be familiar with following configuration.
<bindings>
<wsHttpBinding>
<binding name=”WSBinding” closeTimeout=”00:01:00″ openTimeout=”00:01:00″
receiveTimeout=”00:10:00″ sendTimeout=”00:01:00″ bypassProxyOnLocal=”false”
transactionFlow=”false” hostNameComparisonMode=”StrongWildcard”
maxBufferPoolSize=”524288″ maxReceivedMessageSize=”65536″
messageEncoding=”Text” textEncoding=”utf-8″ useDefaultWebProxy=”true”
allowCookies=”false”>
<readerQuotas maxDepth=”32″ maxStringContentLength=”8192″ maxArrayLength=”16384″
maxBytesPerRead=”4096″ maxNameTableCharCount=”16384″ />
<reliableSession ordered=”true” inactivityTimeout=”00:10:00″
enabled=”false” />
<security mode=”Message”>
<transport clientCredentialType=”Windows” proxyCredentialType=”None”
realm=””>
<extendedProtectionPolicy policyEnforcement=”Never” />
</transport>
<message clientCredentialType=”Windows” negotiateServiceCredential=”true”
algorithmSuite=”Default” establishSecurityContext=”true” />
</security>
</binding>
</wsHttpBinding>
</bidnings>
<client>
<endpoint name=”WSBinding”
address=”http://localhost/MyFirstWebService/TestService.svc”
binding=”wsHttpBinding”
bindingConfiguration=”WSHttpBinding_ITestService”
contract=”ITestService” />
</client>
</System.serviceModel>
Above configuration is the default binding configuration generated on client-side when you add a service reference, because all previous versions of WCF generate default settings that makes it lengthy as well as complex. Default binding configuration is shown in blue text above.
In WCF 4.5, the generated configuration will only have non-default binding configuration as follows:
<bindings>
<wsHttpBinding>
<binding name=”WSBinding” />
</wsHttpBinding>
</bidnings>
<client>
<endpoint name=”WSBinding”
address=”http://localhost/MyFirstWebService/TestService.svc”
binding=”wsHttpBinding”
bindingConfiguration=”WSHttpBinding_ITestService”
contract=”ITestService” />
</client>
</System.serviceModel>
Now, the generated configuration file is pretty much simplified.
WCF – Validating WCF Configuration
Top 10 Interview Questions and Answers Series:
- Top 10 WCF Interview Questions
- Comprehensive Series of WCF Interview Questions
- Top 10 HTML5 Interview Questions
- Top 10 ASP.NET Interview Questions
- Comprehensive Series of ASP.NET Interview Questions
- Top 10 ASP.NET MVC Interview Questions
- Top 10 ASP.NET Web API Interview Questions
- Top 10 ASP.NET AJAX Interview Questions