NetServer configuration
NetServer is a multi-tiered database access layer that bridges communication between clients and the SuperOffice database. It contains both low-level classes for managing data access in onsite domain environments as well as high-level web services for access from anywhere in the world.
For API consumers using either the SuperOffice.NetServer.Core or SuperOffice.NetServer.Services assembly, it is important to understand the configuration requirements and options. This article provides an introduction to the NetServer configuration file for SuperOffice with explanations and examples for each section.
Bootstrapping NetServer in your application required some dependency injection (DI) configuration. See the appropriate DI section for your application type:
- SuperOffice.NetServer.Core: Dependency injection configuration
- SuperOffice.NetServer.Services: Dependency injection configuration
Configuration Files
There are two configuration files of concern. Each application that uses NetServer must contain a well-defined configuration file. This section contains all available settings to configure SuperOffice NetServer and provides explanations and examples for each section.:
- appSettings.json (for logging level)
- Web Application: web.config or Windows Application: MyApp.exe.config
The appSettings.json file is used to configure logging level using "SuperOffice" as the ILoggerProviderPlugin name.
{
"Logging": {
"LogLevel": {
"Default": "Error",
"Microsoft": "Error",
"SuperOffice": "Warning"
}
}
}
The application configuration file must contain a section group named SuperOffice
. Under it, additional sections and section groups are required that define NetServer configuration elements needed to operate.
Configuration sections
Below is a configuration file with only the bare essential SuperOffice sections defined:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="SuperOffice">
<sectionGroup name="Security">
<section name="Cryptography" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</sectionGroup>
<section name="Diagnostics" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<sectionGroup name="Data">
<section name="Session" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<section name="Database" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<section name="ImplicitAnonymous" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<section name="Explicit" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</sectionGroup>
<section name="Documents" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</sectionGroup>
</configSections>
<SuperOffice>
<Security>
<Cryptography>
<add key="SymmetricKey" value="p8/kDmMuw0xuQYFzaVat7lULlns+n/wPFP2bW5+4oTQ="/>
<add key="SymmetricIV" value="1GbQjEeRbfL5EGVxH9a+og=="/>
<add key="SymmetricSecret" value="SuperOffice NetServer Training"/>
</Cryptography>
</Security>
<Diagnostics>
<!-- use appSettings.json to configure log level: errors, warnings, information, trace -->
<!-- Log to the OS event log (default 'True') -->
<add key="LogToEventLog" value="False"/>
<!-- Log to a LogFile (default 'False') -->
<add key="LogToFile" value="True"/>
<!-- Enable vebose mode -->
<add key="EnableScaffolding" value="True"/>
<!-- Folder where the logfile is written, must exist-->
<add key="LogFolder" value="c:\temp"/>
</Diagnostics>
<Data>
<Session>
<add key="Mode" value="Process"/>
</Session>
<Database>
<add key="DatabaseMajor" value="MSSQL"/>
<add key="DatabaseMinor" value="8"/>
<add key="Server" value="ServerName"/>
<add key="Database" value="DatabaseName"/>
<add key="CommandTimeOut" value="300"/>
<add key="TablePrefix" value="CRM7"/>
<add key="ConnectionString" value="Server=[@Server];Database=[@Database];User ID=[@User];Password=[@Password]"/>
</Database>
<Explicit>
<add key="ExternalPersonAllowed" value="False"/>
<add key="EmployeeAllowed" value="True"/>
<add key="SystemAllowed" value="True"/>
<add key="DBUser" value="DbUserName"/>
<add key="DBPassword" value="DbUserPassword"/>
<add key="CommonDBConnection" value="True"/>
</Explicit>
</Data>
<Documents>
<!-- Location of SO_ARC -->
<add key="ArchivePath" value="C:\SO_ARC\"/>
<!-- Location of template folder. -->
<add key="TemporaryPath" value="c:\temp"/>
<!-- Impersonate user document archive or the temporary folder -->
<add key="ImpersonateUser" value="False"/>
<!-- Name of the user to impersonate with -->
<add key="ArchiveUser" value=""/>
<!-- Password of the user to impersonate with -->
<add key="ArchivePassword" value=""/>
<!-- Domain of the user to impersonate with -->
<add key="ArchiveDomain" value=""/>
<!-- Size of internal buffer in KB -->
<add key="BufferSize" value="64"/>
</Documents>
</SuperOffice>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
</startup>
</configuration>
SuperOffice section group
<configuration>
<configSections>
<sectionGroup name="SuperOffice">
<sectionGroup name="Data">
<section name="Session" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Database" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="ImplicitAnonymous" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Explicit" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<sectionGroup name="Factory">
<section name="CustomFactories" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="DynamicLoad" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<sectionGroup name="FeatureToggles">
<section name="State" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<sectionGroup name="Mail">
<section name="Component" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<sectionGroup name="Security">
<section name="Cryptography" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Sentry" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<sectionGroup name="SoFormsAuthentication">
<section name="Pages" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="IgnoreList" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<section name="Audience" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="BatchService" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Client" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="ClientConfigurationProvider" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Cloud" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="CustomProxy" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Diagnostics" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Documents" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Downloads" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Globalization" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Messaging" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Scripting" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Services" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="SubClients" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Threading" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="WebApi" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="Webhooks" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="WebServices" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
</configSections>
<SuperOffice>
<!-- values that determine NetServer runtime behavior -->
</SuperOffice>
<configuration>
In between the ending configSections
and configuration
element, there must be a <SuperOffice></SuperOffice>
element that defines the values that set the NetServer runtime behavior.
View one of the available sections to learn more about the property settings available in each one.
Tip
Consider using the ConfigFile utility class to access the SuperOffice section in the config file.