Configuration Validation in WCF 4.5

Introduction

Today, in this article let's play around with one of the interesting and most useful concepts in WCF 4.5.

Question: What is configuration validation?

In simple terms "It provides warning messages to the user when an input string is not in the correct format in a XML file".

Step 1: The complete code of web.config looks like this:

 

<?xml version="1.0"?>

<configuration>

  <system.serviceModel>

    <bindings>

      <basicHttpBinding>

        <binding name="BasicHttpBinding_IService1"/>

      </basicHttpBinding>

    </bindings>

    <client>

      <endpoint address="http://localhost:4164/Service1.svc" binding="basicHttpBinding" contract="WCFApp.IService1" bindingConfiguration="BasicHttpBinding_IService1" name="BasicHttpBinding_IService1"/>

    </client>

  </system.serviceModel>

  <system.web>

    <compilation debug="true"/>

  </system.web>

</configuration>


Step 2:
The output of configuration validation error looks like this:

Configuration-Validation-in-WCF-4.5.jpg

I hope this article is useful for you.


Similar Articles
MVC Corporation
MVC Corporation is consulting and IT services based company.