<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  
  <configSections>
    
    <sectionGroup name="spring">
      <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
      <section name="parsers" type="Spring.Context.Support.NamespaceParsersSectionHandler, Spring.Core"/>
      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
    </sectionGroup>
  </configSections>

  <spring>

    <context>
      <resource uri="config://spring/objects"/>
    </context>
    
    <parsers>

      <parser namespace="http://www.springframework.net/aop"
              type="Spring.Aop.Config.AopNamespaceParser, Spring.Aop"
              schemaLocation="assembly://Spring.Aop/Spring.Aop.Config/spring-aop-1.1.xsd" />

    </parsers>

    <objects xmlns="http://www.springframework.net"
             xmlns:aop="http://www.springframework.net/aop">
     
      <!-- Service definition -->
      <object id="calculator" singleton="false"
              type="Spring.WcfQuickStart.CalculatorService, Spring.WcfQuickStart.ServerApp">
        <property name="SleepInSeconds" value="1"/>
      </object>

      <object id="calculatorServiceHost" type="Spring.ServiceModel.Activation.ServiceHostFactoryObject, Spring.Services">
        <property name="TargetName" value="calculator" />
      </object>

      <object id="serviceOperation" type="Spring.Aop.Support.SdkRegularExpressionMethodPointcut, Spring.Aop">
        <property name="pattern" value="Spring.WcfQuickStart.*"/>
      </object>
      
      <object id="perfAdvice" type="Spring.WcfQuickStart.SimplePerformanceInterceptor, Spring.WcfQuickStart.ServerApp">
        <property name="Prefix" value="Service Layer Performance"/>
      </object>
      
      <aop:config>
        <aop:advisor pointcut-ref="serviceOperation" advice-ref="perfAdvice"/>
      </aop:config>

    </objects>

  </spring>
  
  <system.serviceModel>

    <services>
      <service name="calculator" behaviorConfiguration="DefaultBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8000/Spring.WcfQuickStart/service"/>
          </baseAddresses>
        </host>
        <endpoint address=""
                  binding="basicHttpBinding"
                  contract="Spring.WcfQuickStart.ICalculator" />
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="DefaultBehavior">
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="True"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

  </system.serviceModel>

</configuration>