afedyanin
10/13/2017 - 2:42 PM

WCF Sample: Bindings & Behaviors

Simple configs for bindings & behaviors Metadata exchange sample

  <system.serviceModel>
    <services>
      <service name="GeoLib.Services.GeoManager">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8080"/>
            <add baseAddress="net.tcp://localhost:8009/GeoService" />
          </baseAddresses>
        </host>
        <endpoint address=""
                  binding="netTcpBinding"
                  contract="GeoLib.Contracts.IGeoService" />
        <endpoint address="MEX"
                  binding="mexTcpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
  <system.serviceModel>
    <client>
      <endpoint address="net.tcp://localhost:8009/GeoService"
                binding="netTcpBinding"
                contract="GeoLib.Contracts.IGeoService"/>
    </client>
    <bindings>
      <netTcpBinding>
        <binding sendTimeout="00:10:00" maxReceivedMessageSize="2000000" receiveTimeout="00:20:00">
          <reliableSession enabled="true" inactivityTimeout="00:20:00" ordered="true" />
        </binding>
      </netTcpBinding>
    </bindings>
  </system.serviceModel>
  <system.serviceModel>
    <services>
      <service name="GeoLib.Services.GeoManager">
        <endpoint address="net.tcp://localhost:8009/GeoService" binding="netTcpBinding" contract="GeoLib.Contracts.IGeoService" />
      </service>
    </services>
    <bindings>
      <netTcpBinding>
        <binding sendTimeout="00:10:00" maxReceivedMessageSize="2000000" receiveTimeout="00:20:00">
          <reliableSession enabled="true" inactivityTimeout="00:20:00" ordered="true" />
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceThrottling maxConcurrentCalls="16" maxConcurrentInstances="116" maxConcurrentSessions="100" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>