<?xml version="1.0"?>
<configuration>

  <configSections>
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
    <section name="AisConfiguration_Paths" type="Ais.Data.AisConfigurationSection_Paths, AisData" />
    <section name="AisConfiguration_Commands" type="Ais.Data.AisConfigurationSection_Commands, AisData" />
    <section name="AisConfiguration_Databases" type="Ais.Data.AisConfigurationSection_Databases, AisData" />
  </configSections>
  
  <AisConfiguration_Paths xmlns="http://Ais.Data">
    <ConfigPaths>
      <ConfigPath name="RESSOURCES" url ="c:\crystal\khm_1\test\ressources" accessrights ="read" description="Le chemin vers les ressources word/excel/menu" />
      <ConfigPath name="SAVE" url ="c:\crystal\khm_1\test\save" accessrights ="readwrite" description="Le chemin des sauvegardes" encoding="utf8" />
    </ConfigPaths>
  </AisConfiguration_Paths> 

  <AisConfiguration_Commands xmlns="http://Ais.Data" allowall="1">
    <ConfigCommands>
      <ConfigCommand name="menu" type="MENU" description="le menu de l'applicatif"/>
    </ConfigCommands>
  </AisConfiguration_Commands>

  <AisConfiguration_Databases xmlns="http://Ais.Data">
    <ConfigDatabases>
      <ConfigDatabase name="AIS" connectionstring ="Data Source=WIN-BJ70289JAIK\SQL2008R2;Initial Catalog=crystal_khm_1_test;Integrated Security=SSPI;Max Pool Size=10;Min Pool Size=5;Pooling=False;" connection_timeout ="30" query_timeout="600" description="La connexion principale" type="SqlServer" is_default="true"/>
    </ConfigDatabases>
  </AisConfiguration_Databases>

  <nlog throwExceptions="false" internalLogFile="${basedir}/log/_NLog.txt" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <variable name="logDirectory" value="${basedir}/log/${shortdate}-${logger}" />
    <targets>
      <target name="info" xsi:type="File" fileName="${logDirectory}.txt" layout="${longdate}|${level}|${stacktrace}|${message}" />
      <target name="error" xsi:type="File" fileName="${logDirectory}.txt" layout="${longdate}|${level}|${stacktrace}|${message}" />
    </targets>
    <rules>
      <logger name="info" minlevel="Trace" writeTo="info" />
      <logger name="error" minlevel="Trace" writeTo="error" />
    </rules>
  </nlog>

  <system.serviceModel>
    <services>
      <service name="AisSrvBO.Service.AisService" behaviorConfiguration="AisServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:18011/AisService"/>
          </baseAddresses>
        </host>
        <endpoint address="net.tcp://localhost:8011/" binding="netTcpBinding" contract="AisSrvBO.Service.IAisService" behaviorConfiguration="netTcpBehaviour" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <bindings>
      <netTcpBinding>
        <binding maxReceivedMessageSize="2147483647" maxConnections="2147483647">
          <reliableSession ordered="true"/>
          <security mode="None">
            <transport clientCredentialType="None"></transport>
            <message clientCredentialType="None"/>
          </security>
          <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxStringContentLength="2147483647"/>
        </binding> 
      </netTcpBinding>
      <wsHttpBinding>
        <binding>
          <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxStringContentLength="2147483647"/>
        </binding>
      </wsHttpBinding>
      <basicHttpBinding>
        <binding>
          <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxStringContentLength="2147483647"/>
        </binding> 
      </basicHttpBinding>  
    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior name="netTcpBehaviour">
         
        </behavior>
      </endpointBehaviors> 
      <serviceBehaviors>
        <behavior name="AisServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <serviceThrottling maxConcurrentCalls ="20" maxConcurrentInstances ="30" maxConcurrentSessions ="40"/>
          <serviceTimeouts />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>

</configuration>
