The Web.config file is the primary configuration file for any web service. Since the CSF connectors are implemented as web services, their Web.config files must have the proper setting in order for the connectors to function. Each connector relies on the Web.config to be able to find the Common.config, EnterpriseInstrumentation.config, PolicyCache.config, and the location of their own configuration files.
Complete details of the web.config file can be found at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconformatofconfigurationfiles.asp
--------------------------------------------------------------------------
Please Note: All < tags are replaced by [
and > tags are replaced by ]
to avoid HTML errors in post
---------------------------------------------------------------------------
The five sections of the Web.config file that are critical to the operation of the CSF connectors - [configSections], [system.web][httpHanders], [Microsoft.Csf], [microsoft.web.services2], and [appSettings].
[configSections] contains the "Microsoft.Csf" and "Microsoft.Web.Services2" [sectionGroup] tags - these [sectionGroup] tags need to be specified in order for the sections to be used properly. Here is an example:
[configSections]
[sectionGroup name="Microsoft.Csf"]
[section name="ConfigFiles" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null"/]
[/sectionGroup]
[section name="microsoft.web.services2" type="Microsoft.Web.Services2.Configuration.WebServicesConfiguration, Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /]
[/configSections]
[system.web][httpHandlers] this section maps a default path to an object and assembly name. This enables IIS to locate the correct Dll when it receives a call for one of the CSF connectors. Here is an example from the Identity Manager's Web.config file:
[system.web]
[httpHandlers]
[!-- Identity manager handlers --]
[add verb="*" path="OrganizationManager.ashx" type="Microsoft.Csf.Connector.IdentityManager.OrganizationManager, Microsoft.Csf.Connector.IdentityManager" /]
[add verb="*" path="UserGroupManager.ashx" type="Microsoft.Csf.Connector.IdentityManager.UserGroupManager, Microsoft.Csf.Connector.IdentityManager" /]
...
[/httpHandlers]
[Microsoft.Csf] this section specifies the CSF-specific settings, such as the location of the Common.cofig file, and the location of the connector's individual configuration file. Here is an example from the Identity Manager's Web.config file:
[Microsoft.Csf]
[ConfigFiles]
[add key="Common" value="C:\CsfConfig\Common.config" /]
[add key="IdentityManager" value="C:\CsfConfig\IdentityManager.config" /]
[/ConfigFiles]
[/Microsoft.Csf]
[microsoft.web.serivces2] section specifies the location of the WSE Trace files in the [diagnostics] tag - note that the [policyTrace] tag is optional. The [policy] tag hold the path to the PolicyCache.config file. The [security] tag holds the values for using certificates.
[microsoft.web.services2]
[diagnostics]
[trace enabled="true" input="c:\CsfTrace\Identity_InputTrace.webinfo" output="c:\CsfTrace\Identity_OutputTrace.webinfo" /]
[policyTrace enabled="true" input="C:\CsfTrace\Identity_receivePolicy.webinfo" output="C:\CsfTrace\Identity_sendPolicy.webinfo"/]
[/diagnostics]
[!-- security policy configuration --]
[policy]
[cache name="C:\CsfConfig\PolicyCache.config" /]
[/policy]
[!-- Test certification location and flags to allow test certs to work --]
[security]
[x509 storeLocation="LocalMachine" allowTestRoot="true"
allowRevocationUrlRetrieval="false" verifyTrust="false" /]
[/security]
[!-- production certification lookup location
[security]
[x509 storeLocation="LocalMachine"/]
[/security]
--]
[/microsoft.web.services2]
[appSettings] holds the path to the EnterpriseInstrumentation.config file, as well as additional configuration parameters:
[appSettings]
[add key="instrumentationConfigFile" value="C:\CsfConfig\EnterpriseInstrumentation.config" /]
[/appSettings]
Ref: Web.config
http://msdn.microsoft.com/en-us/library/aa306178.aspx
Working with web.config Files in Windows SharePoint Services(V2)
http://msdn.microsoft.com/en-us/library/dd587352(office.11).aspx
Working with Web.config Files (V3)
http://msdn.microsoft.com/en-us/library/ms460914.aspx
You may need to modify Web.config files to make your solution work in the Windows SharePoint Services environment. For example, you might need to add a SafeControl entry, register an HttpModule, or customize SessionState, but a Windows SharePoint Services deployment includes numerous Web.config files, one in each Web application, and one in each front-end Web server.
To make customizing Web.config files easier, Windows SharePoint Services provides two ways to make changes. First, you can declaratively register Web.config entries by creating an XML file that describes a set of Web.config modifications. To do this, you create a custom webconfig.XYZ.xml file in \\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG, where XYZ is a unique ID that you use to identify your solution. For an example that shows how to create a custom Web.config file to change settings, see How To: Add Custom Configuration Settings to Extend a Web Application.
In addition to creating a custom Web.config file, however, you can use the Windows SharePoint Services object model to modify Web.config settings. For an example that shows how to modify settings programmatically, see How To: Use the Object Model to Modify Web.config.
Changes that you define through the object model or through XML are always applied when you create a Web application.
Important:
The Web.config files in the \wpresources folders should not be modified. The settings of these files disallow pages or items that can be compiled. If these settings are changed, the security state for the compiled code differs greatly from the security state for code that runs from the Local_Drive:\Inetpub\wwwroot directory.
Caution:
Changes that you make to Web.config may be overwritten when you install updates or service packs for Windows SharePoint Services, or when you upgrade an installation to the next product version.
How To: Use the Object Model to Modify Web.config
In Windows SharePoint Services 3.0, you can modify Web.config settings by creating an XML file that describes the modifications, or you can perform the same task programmatically by using the SPWebConfigModification class of the Microsoft.SharePoint.Administration namespace, which allows you to dynamically register entities.
Ref: http://msdn.microsoft.com/en-us/library/bb861909.aspx
How To Create the Web.config File for an ASP.NET Application
http://support.microsoft.com/kb/815179
Tuesday, February 23, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment