Monday, 21 September 2015

WCF self host App.config file Samples

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>

      <service name ="WCFLibrary1.WCFService1"
               behaviorConfiguration="svcBehavior">
        <endpoint address ="http://localhost:8888/WCFService1"
                  binding ="basicHttpBinding" contract="WCFLibrary1.IWCFService1">        
        </endpoint>

        <endpoint address="http://localhost:8888/WCFService1/MEX"
                  binding="mexHttpBinding" contract="IMetadataExchange">        
        </endpoint>
        </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name ="svcBehavior">
          <serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:8888/WCFService1">
          </serviceMetadata>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>