Reader Level:
Articles

Configuration Validation in WCF 4.5

By Vijay Prativadi on October 06, 2012
Today, in this article let’s play around with one of the interesting and most useful concepts in WCF 4.5.
  • 0
  • 0
  • 4192

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.

Vijay Prativadi

Hey Everyone, It's Vijay. I am SDE mostly up on Microsoft Technologies. If you are thinking to know what I do mostly when at work. I get a chance to work upon few Microsoft technologies. All the way along my core tech... Read more

COMMENT USING

Trending up