Reader Level:
Article
WCF

Configuration Validation in WCF 4.5

By Vijay Prativadi on Oct 06 2012
Today, in this article let’s play around with one of the interesting and most useful concepts in WCF 4.5.
    • Like
    • Love It
    • Awesome
    • Interesting
    • It's Okay
    • Thumbs Down
  • 7k
  • 0

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.