The Session Web.Config File
Collapse the table of content
Expand the table of content

 

Connected Services Framework
Connected Services Framework 3.0 Developers Guide Send comments on this topic.
The Session Web.Config File

The Web.config file specifies the Web configuration for the Session Web service. By default, the Web.config file for Session includes the following configuration sections:

  • loggingConfiguration. This section specifies the formatters and listeners for logging and tracing auditing and event information for the Session Web service. By default, information is logged to files in the C:\CsfTrace folder.
  • microsoft.connectedServices. This section specifies the names of the configuration and policy mapping files for the Session Web service. Additionally, it contains settings that control the Custom Username Token Manager, and specifies the authorization roles that are required by users who create and control sessions. For more information, see Enabling Custom Username Token Manager in WSE.
  • microsoft.web.services3. This section specifies the name of the file that contains WSE 3.0 policies that are implemented or used by the Session Web service. The default value for this filename is SessionPolicy.config. It also controls the output location of the Session trace files. By default, these files are created in the C:\Program Files\Microsoft CSF\V3.0\Connectors\Session\Logs folder. 
  • httpHandlers. This section specifies the paths for the endpoints for each of the Session component Web services.  By default, the paths are Session.ashx, SessionAdmin.ashx, and SessionManagerAdmin.ashx.

Example Web.Config File

<?xml version="1.0" encoding="utf-8"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
  <configSections>
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <!-- CSF configuration section definition -->
    <sectionGroup name="microsoft.connectedServices">
      <section name="componentConfigFiles" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="customUsernameTokenManager" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
    </sectionGroup>
  </configSections>
  <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
    defaultCategory="" logWarningsWhenNoCategoriesMatch="true">
    <listeners>
      <add source="Session" formatter="Text Formatter" log="Application"
        machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Formatted EventLog TraceListener" />
      <add fileName="C:\CsfTrace\SessionAuditTrace.log" header="----------------------------------------"
        footer="----------------------------------------" formatter=""
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="SessionAudit TraceListener" />
      <add fileName="C:\CsfTrace\SessionDevTrace.log" header="----------------------------------------"
        footer="----------------------------------------" formatter=""
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="SessionDev TraceListener" />
    </listeners>
    <formatters>
      <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Text Formatter" />
    </formatters>
    <logFilters>
      <add categoryFilterMode="DenyAllExceptAllowed" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.CategoryFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Category Filter">
        <categoryFilters>
          <add name="Session OperationalEvent" />
        </categoryFilters>
      </add>
    </logFilters>
    <categorySources>
      <add switchValue="All" name="Session Audit">
        <listeners>
          <add name="SessionAudit TraceListener" />
        </listeners>
      </add>
      <add switchValue="All" name="Session DevTracer">
        <listeners>
          <add name="SessionDev TraceListener" />
        </listeners>
      </add>
      <add switchValue="All" name="Session OperationalEvent">
        <listeners>
          <add name="Formatted EventLog TraceListener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events" />
      <notProcessed switchValue="All" name="Unprocessed Category" />
      <errors switchValue="All" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="Formatted EventLog TraceListener" />
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>
  <microsoft.connectedServices>
    <componentConfigFiles>
      <add key="Session" value="Session.config" />
      <add key="PolicyMapping" value="SessionPolicyMapping.config" />
    </componentConfigFiles>
    <customUsernameTokenManager>
      <add key="ExpirationTimeout" value="1800" />
      <add key="MaximumUsernameTokenCount" value="50000" />
      <add key="AuthorizationRoles" value="Contoso\Requestors@CSF_SessionAdmin,Contoso\Requestors@CSF_SessionManagerAdmin,Contoso\Requestors@CSF_Session" />
      <add key="LogCategory" value="Session OperationalEvent" />
    </customUsernameTokenManager>
  </microsoft.connectedServices>
  <appSettings />
  <microsoft.web.services3>
    <policy fileName="SessionPolicy.config" />
    <diagnostics>
      <!--  Create c:\CSFTrace folder to enable the traces to be written to that folder -->
      <trace enabled="false" input="C:\CSFTrace\Session_InputTrace.webinfo" output="C:\CSFTrace\Session_OutputTrace.webinfo" />
      <!--
            Configures the error reporting facility.


            If the enabled attribute is set to true explicitly, WSE will send back the detailed error information,
            i.e. a full stack trace as well as the information about all the inner exceptions.
            If the enabled attribute is set to false explicitly, WSE will send back the custom (friendly) messages,
            i.e. the top level exception message without stack trace and information about the inner exceptions.
       -->
      <detailedErrors enabled="false" />
    </diagnostics>
    <security>
      <securityTokenManager>
        <add type="Microsoft.ConnectedServices.Sdk.Security.CustomUsernameTokenManager, Microsoft.ConnectedServices.Sdk" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken" />
      </securityTokenManager>
    </security>
  </microsoft.web.services3>
  <system.web>
    <httpHandlers>
      <add verb="*" path="SessionManagerAdmin.ashx" type="Microsoft.ConnectedServices.Connector.Session.SessionManagerAdminWS, Microsoft.ConnectedServices.Connector.Session" />
      <add verb="*" path="SessionAdmin.ashx" type="Microsoft.ConnectedServices.Connector.Session.SessionAdminWS,        Microsoft.ConnectedServices.Connector.Session" />
      <add verb="*" path="Session.ashx" type="Microsoft.ConnectedServices.Connector.Session.SessionWS,             Microsoft.ConnectedServices.Connector.Session" />
    </httpHandlers>
    <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
    <compilation debug="true" defaultLanguage="C#">
      <assemblies>
        <add assembly="Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
    <authentication mode="Windows" />
    <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.


        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    <webServices>
      <soapExtensionImporterTypes>
        <add type="Microsoft.Web.Services3.Description.WseExtensionImporter, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </soapExtensionImporterTypes>
    </webServices>
  </system.web>
</configuration>

Show:
© 2016 Microsoft