<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
<!--<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" />-->
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="File" fileName="${basedir}/Logs/ServiceLog.txt" layout="${date}: ${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="logfile" />
</rules>
</nlog>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<namespace name="Medrisk.BusinessServices.WcfServices.v1" />
<namespace name="Medrisk.BusinessServices.DataAccess" />
<namespace name="Medrisk.BusinessServices.Business" />
<namespace name="Microsoft.Practices.Unity" />
<namespace name="Microsoft.Practices.Unity.Configuration" />
<namespace name="Medrisk.BusinessServices.Business.Entities" />
<assembly name="Medrisk.BusinessServices.WcfServices" />
<assembly name="Medrisk.BusinessServices.DataAccess" />
<assembly name="Medrisk.BusinessServices.Business" />
<assembly name="Microsoft.Practices.Unity" />
<assembly name="Microsoft.Practices.Unity.Configuration" />
<container name="unity">
<register type="PackageEntities" mapTo="PackageEntities" name="defaultPackageEntities">
<lifetime type="HierarchicalLifetimeManager"></lifetime>
<constructor>
<param name="connectionString" value="name=PackageEntities"></param>
</constructor>
</register>
<register type="IUnitOfWork" mapTo="UnitOfWork" name="defaultUnitOfWork">
<lifetime type="HierarchicalLifetimeManager"></lifetime>
<constructor>
<param name="context" dependencyType="PackageEntities" dependencyName="defaultPackageEntities" />
</constructor>
</register>
<register type="IPackageService" mapTo="PackageService">
<lifetime type="HierarchicalLifetimeManager" />
<property name="UnitOfWork" dependencyType="IUnitOfWork" dependencyName="defaultUnitOfWork" />
</register>
</container>
</unity>
<connectionStrings>
<add name="PackageEntities" connectionString="metadata=res://*/Entities.PackageEntities.csdl|res://*/Entities.PackageEntities.ssdl|res://*/Entities.PackageEntities.msl;provider=System.Data.SqlClient;provider connection string='Data source=MRSQLDEV01;initial catalog=Medrisk;integrated security=True;multipleactiveresultsets=True;App=EntityFramework'" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="PackageQueryCacheProfile" enabled="true" duration="0" noStore="true" varyByParam=""/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<customErrors mode="Off" />
<identity impersonate="false" />
<authorization>
</authorization>
</system.web>
<system.webServer>
<security>
<access sslFlags="None" />
<authentication>
<iisClientCertificateMappingAuthentication enabled="false" oneToOneCertificateMappingsEnabled="true"></iisClientCertificateMappingAuthentication>
</authentication>
</security>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
<handlers>
<remove name="SimpleHandlerFactory-Integrated" />
<add name="SimpleHandlerFactory-Integrated" path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
</handlers>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
<serviceActivations>
<add factory="Medrisk.BusinessServices.WcfServices.WcfServiceFactory" service="Medrisk.BusinessServices.WcfServices.v1.PackageService" relativeAddress="v1/PackageService.svc" />
</serviceActivations>
</serviceHostingEnvironment>
<behaviors>
<endpointBehaviors>
<behavior name="restfulBehavior">
<webHttp helpEnabled="true" automaticFormatSelectionEnabled="true" defaultOutgoingResponseFormat="Xml" />
</behavior>
<behavior name="soapyBehavior">
<wsdlExtensions location="v1/PackageService.svc" singleFile="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="productionServiceBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceAuthorization impersonateCallerForAllOperations="true" principalPermissionMode="UseAspNetRoles" />
<serviceCredentials>
<clientCertificate>
<authentication mapClientCertificateToWindowsAccount="true" certificateValidationMode="PeerTrust" revocationMode="NoCheck" />
</clientCertificate>
</serviceCredentials>
<auditLogging />
</behavior>
<behavior name="defaultServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
<auditLogging />
</behavior>
</serviceBehaviors>
</behaviors>
<extensions>
<behaviorExtensions>
<add name="auditLogging" type="Medrisk.BusinessServices.WcfServices.Behaviors.CallAuditorServiceElement, Medrisk.BusinessServices.WcfServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
<add name="wsdlExtensions" type="WCFExtrasPlus.Wsdl.WsdlExtensionsConfig, WCFExtrasPlus, Version=2.3.0.2, Culture=neutral, PublicKeyToken=f8633fc5451b43fc" />
</behaviorExtensions>
</extensions>
<bindings>
<basicHttpBinding>
<binding name="secureBasicBinding">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="secureWebBinding">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="defaultServiceBehavior" name="Medrisk.BusinessServices.WcfServices.v1.PackageService">
<host>
</host>
<endpoint address="/rest" behaviorConfiguration="restfulBehavior" binding="webHttpBinding" bindingConfiguration="" name="PacakgeServiceRest.v1" bindingNamespace="http://services.medrisknet.com/business/v1" contract="Medrisk.BusinessServices.WcfServices.v1.IPackageService">
<identity>
</identity>
</endpoint>
<endpoint address="/soap" behaviorConfiguration="soapyBehavior" binding="basicHttpBinding" bindingConfiguration="" name="PackageServiceSoap.v1" bindingNamespace="http://services.medrisknet.com/business/v1" contract="Medrisk.BusinessServices.WcfServices.v1.IPackageService">
<identity>
</identity>
</endpoint>
</service>
</services>
</system.serviceModel>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+++++++++++++++++++++++++++++
Unity :
Unity is a lightweight, extensible dependency injection container that supports interception, constructor injection, property injection, and method call injection. You can use Unity in a variety of different ways to help decouple the components of your applications, to maximize coherence in components, and to simplify design, implementation, testing, and administration of these applications.
Unity is a general-purpose container for use in any type of Microsoft® .NET Framework-based application. It provides all of the features commonly found in dependency injection mechanisms, including methods to register type mappings and object instances, resolve objects, manage object lifetimes, and inject dependent objects into the parameters of constructors and methods and as the value of properties of objects it resolves.
+++++++++++++++++
Common Logging
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
<!--<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" />-->
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="File" fileName="${basedir}/Logs/ServiceLog.txt" layout="${date}: ${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="logfile" />
</rules>
</nlog>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<namespace name="Medrisk.BusinessServices.WcfServices.v1" />
<namespace name="Medrisk.BusinessServices.DataAccess" />
<namespace name="Medrisk.BusinessServices.Business" />
<namespace name="Microsoft.Practices.Unity" />
<namespace name="Microsoft.Practices.Unity.Configuration" />
<namespace name="Medrisk.BusinessServices.Business.Entities" />
<assembly name="Medrisk.BusinessServices.WcfServices" />
<assembly name="Medrisk.BusinessServices.DataAccess" />
<assembly name="Medrisk.BusinessServices.Business" />
<assembly name="Microsoft.Practices.Unity" />
<assembly name="Microsoft.Practices.Unity.Configuration" />
<container name="unity">
<register type="PackageEntities" mapTo="PackageEntities" name="defaultPackageEntities">
<lifetime type="HierarchicalLifetimeManager"></lifetime>
<constructor>
<param name="connectionString" value="name=PackageEntities"></param>
</constructor>
</register>
<register type="IUnitOfWork" mapTo="UnitOfWork" name="defaultUnitOfWork">
<lifetime type="HierarchicalLifetimeManager"></lifetime>
<constructor>
<param name="context" dependencyType="PackageEntities" dependencyName="defaultPackageEntities" />
</constructor>
</register>
<register type="IPackageService" mapTo="PackageService">
<lifetime type="HierarchicalLifetimeManager" />
<property name="UnitOfWork" dependencyType="IUnitOfWork" dependencyName="defaultUnitOfWork" />
</register>
</container>
</unity>
<connectionStrings>
<add name="PackageEntities" connectionString="metadata=res://*/Entities.PackageEntities.csdl|res://*/Entities.PackageEntities.ssdl|res://*/Entities.PackageEntities.msl;provider=System.Data.SqlClient;provider connection string='Data source=MRSQLDEV01;initial catalog=Medrisk;integrated security=True;multipleactiveresultsets=True;App=EntityFramework'" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="PackageQueryCacheProfile" enabled="true" duration="0" noStore="true" varyByParam=""/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<customErrors mode="Off" />
<identity impersonate="false" />
<authorization>
</authorization>
</system.web>
<system.webServer>
<security>
<access sslFlags="None" />
<authentication>
<iisClientCertificateMappingAuthentication enabled="false" oneToOneCertificateMappingsEnabled="true"></iisClientCertificateMappingAuthentication>
</authentication>
</security>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
<handlers>
<remove name="SimpleHandlerFactory-Integrated" />
<add name="SimpleHandlerFactory-Integrated" path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
</handlers>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
<serviceActivations>
<add factory="Medrisk.BusinessServices.WcfServices.WcfServiceFactory" service="Medrisk.BusinessServices.WcfServices.v1.PackageService" relativeAddress="v1/PackageService.svc" />
</serviceActivations>
</serviceHostingEnvironment>
<behaviors>
<endpointBehaviors>
<behavior name="restfulBehavior">
<webHttp helpEnabled="true" automaticFormatSelectionEnabled="true" defaultOutgoingResponseFormat="Xml" />
</behavior>
<behavior name="soapyBehavior">
<wsdlExtensions location="v1/PackageService.svc" singleFile="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="productionServiceBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceAuthorization impersonateCallerForAllOperations="true" principalPermissionMode="UseAspNetRoles" />
<serviceCredentials>
<clientCertificate>
<authentication mapClientCertificateToWindowsAccount="true" certificateValidationMode="PeerTrust" revocationMode="NoCheck" />
</clientCertificate>
</serviceCredentials>
<auditLogging />
</behavior>
<behavior name="defaultServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
<auditLogging />
</behavior>
</serviceBehaviors>
</behaviors>
<extensions>
<behaviorExtensions>
<add name="auditLogging" type="Medrisk.BusinessServices.WcfServices.Behaviors.CallAuditorServiceElement, Medrisk.BusinessServices.WcfServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
<add name="wsdlExtensions" type="WCFExtrasPlus.Wsdl.WsdlExtensionsConfig, WCFExtrasPlus, Version=2.3.0.2, Culture=neutral, PublicKeyToken=f8633fc5451b43fc" />
</behaviorExtensions>
</extensions>
<bindings>
<basicHttpBinding>
<binding name="secureBasicBinding">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="secureWebBinding">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="defaultServiceBehavior" name="Medrisk.BusinessServices.WcfServices.v1.PackageService">
<host>
</host>
<endpoint address="/rest" behaviorConfiguration="restfulBehavior" binding="webHttpBinding" bindingConfiguration="" name="PacakgeServiceRest.v1" bindingNamespace="http://services.medrisknet.com/business/v1" contract="Medrisk.BusinessServices.WcfServices.v1.IPackageService">
<identity>
</identity>
</endpoint>
<endpoint address="/soap" behaviorConfiguration="soapyBehavior" binding="basicHttpBinding" bindingConfiguration="" name="PackageServiceSoap.v1" bindingNamespace="http://services.medrisknet.com/business/v1" contract="Medrisk.BusinessServices.WcfServices.v1.IPackageService">
<identity>
</identity>
</endpoint>
</service>
</services>
</system.serviceModel>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+++++++++++++++++++++++++++++
Unity :
Unity is a lightweight, extensible dependency injection container that supports interception, constructor injection, property injection, and method call injection. You can use Unity in a variety of different ways to help decouple the components of your applications, to maximize coherence in components, and to simplify design, implementation, testing, and administration of these applications.
Unity is a general-purpose container for use in any type of Microsoft® .NET Framework-based application. It provides all of the features commonly found in dependency injection mechanisms, including methods to register type mappings and object instances, resolve objects, manage object lifetimes, and inject dependent objects into the parameters of constructors and methods and as the value of properties of objects it resolves.
+++++++++++++++++
Common Logging
No comments:
Post a Comment