<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
    </startup>
  <system.serviceModel>

    <behaviors>
      <serviceBehaviors>
        <behavior name="SecureServiceBehaviour">
          <serviceCredentials>
            <clientCertificate>
              <authentication certificateValidationMode="ChainTrust" revocationMode="NoCheck" trustedStoreLocation="LocalMachine"/>
            </clientCertificate>
            <serviceCertificate findValue="7b 95 00 83 60 58 81 a3 c9 48 e8 b0 fd 4b f3 57 30 c2 bf 84" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/>
          </serviceCredentials>
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="WebServiceBehaviour">
          <webHttp/>        
        </behavior>
      </endpointBehaviors>
    </behaviors>

    <services>
      <service behaviorConfiguration="SecureServiceBehaviour" name="BaxiWcfService.BaxiHttpsService">

        <endpoint address="" behaviorConfiguration="WebServiceBehaviour" binding="webHttpBinding" contract="BaxiWcfService.BaxiHttpsService"/>       
        <endpoint address="" behaviorConfiguration="WebServiceBehaviour" binding="webHttpBinding" contract="BaxiWcfService.BaxiHttpsService" bindingConfiguration="SecureBinding"/>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
       
     <host>
          <baseAddresses>
             <add baseAddress="http://localhost:9003"/>
             <add baseAddress="https://localhost:9001"/>
          </baseAddresses>
        </host>
      </service>
    </services>

    <bindings>
      <webHttpBinding>
        <binding name="SecureBinding">
          <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
        </binding>     
      </webHttpBinding>
    </bindings>
     
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtTransportLevel="true" logMessagesAtServiceLevel="true"/>
    </diagnostics>

  </system.serviceModel>

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
        <listeners>
          <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\baxi\https\Traces.svclog"/>
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

</configuration>
