1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing"
          propagateActivity="true">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelTraceListener">
            <filter type="" />
          </add>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add initializeData="c:\projects\lab\wpfapplication1\wpfapplication1\app_tracelog.svclog"
          type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
          name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
        <filter type="" />
      </add>
    </sharedListeners>
  </system.diagnostics>

  <system.serviceModel>
    <diagnostics wmiProviderEnabled="true">
      <messageLogging logEntireMessage="true"
                      logMessagesAtServiceLevel="true"
                      logMessagesAtTransportLevel="true" />
    </diagnostics>


    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IApiService">
          <security mode="Transport">
            <transport clientCredentialType="Certificate"  />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>

    <client>
      <endpoint address="https://servername/path/servicehost.svc"
                binding="wsHttpBinding"
                bindingConfiguration="WSHttpBinding_IApiService"
                behaviorConfiguration="credentialConfiguration"
                contract="SslVendorService.IApiService"
                name="WSHttpBinding_IApiService" />
    </client>

    <behaviors>
      <endpointBehaviors>
        <behavior name="credentialConfiguration">
          <clientCredentials>

            <serviceCertificate>
              <authentication certificateValidationMode="None"/>
            </serviceCertificate>

            <clientCertificate findValue="CN=tempCertClient2"
                               storeLocation="LocalMachine"
                               x509FindType="FindBySubjectDistinguishedName" />
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
    </behaviors>

  </system.serviceModel>

</configuration>