WCF Entries in Configuration Files

A typical WCF configuration file contains the four elements as the following.

System.ServiceModel
The root element is System.ServiceModel

Services
Services contains one or more service elements

Endpoint
The endpoint element defines the address, binding, and contract.

Host
The host element defines base addresses and time-outs

<system.serviceModel> 

  <services> 

     <service name="ConnectedWCF.BankService">

         <endpoint address="BankService"

            binding="basicHttpBinding"

            contract="ConnectedWCF.IBank"/> 

         <host>

            <baseAddresses>

               <baseAddress baseAddress="http://localhost:8080/Simple"/>

            </baseAddresses>

         </host>

      </service>

   </services>

</system.serviceModel>

 

For more information about the elements in a WCF configuration file and how they fit together, see <system.serviceModel> and Windows Communication Foundation Configuration Schema.

Tags: