Jump to: navigation, search

Configuration Files/web.config


This is the main configuration file of the web service. The web service is configured using this main configuration file and the specific files.

Sections

These sections will be found only in the web service configuration file.

appSettings

See Configuration Files/AppSettings.config.

system.web

This does not have to be edited in general.

system.webServer

This does not have to edited in general, except the setting for the maximum allowed size of received content. This can be changed by editing the value maxAllowedContentLength within the section requestFiltering/requestLimits.

runtimeSettings

In this file runtime specific configurations can be defined, as for example the probing path for plugins.

system.diagnostics

Activity Tracing or Windows Communication Foundation Tracing in system.diagnostics, which is used in WCF instead of a debugger to understand how an app is behaving or why it faults (fault monitoring and analysis), WCF can output data for diagnostic tracing such as checking all the operation calls, code exceptions, warnings, and other important (significant processing) events and when the tracing feature malfunctions it can write Windows Error Events.

  • System.ServiceModel.MessageLogging : Logs all messages that flow through the system. It can be added to enhance debugging.
  • System.ServiceModel : Logs all stages of WCF processing, whenever configuration is read, a message is processed in transport, security processing, a message is dispatched in user code, and so on.(Message process, Reading of configuration information, Transport-level action, Security requests).
    • propagetActivity : by using this and setting its value to true, we can take trace files generated by any two endpoints and observe how the set of traces moves from one endpoint to another endpoint. (not used by default but can be turned on if such information is needed, we are using it right now in our Web configuration).
    • ActivityTracing : added if we want to use a user-defined trace source.
  • System.Runtime.Serialization : Logs when objects are read or written. Information about object serialization or deserialization. Good to use so we can see the content of requests.
  • System.Diagnostics.XmlWriterTraceListener : is the standard .Net Framework trace listener. Process the data WCF provides in a specific output format.
  • Trace Levels:
    • Critical: Logs Fail-Fast and Event Log entries, and trace correlation information. The following are some examples of when you might use the Critical level: Your AppDomain went down because of an unhandled exception. Your application fails to start. The message that caused the failure originated from the process MyApp.exe.
    • Error: Logs all exceptions. You can use the Error level in the following situations: Your code crashed because of an Invalid Cast Exception. A "failed to create endpoint" exception is causing your application to fail on startup.
    • Warning: A condition exists that may subsequently result in an error or critical failure. You can use this level in the following situations: The application is receiving more requests than its throttling settings allow. The receiving queue is at 98 percent of its configured capacity.
    • Information: Messages helpful for monitoring and diagnosing system status, measuring performance, or profiling are generated. You can utilize such information for capacity planning and performance management. You can use this level in the following situations: A failure occurred after the message reached the AppDomain and was deserialized. A failure occurred while the HTTP binding was being created.
    • Verbose: Debug-level tracing for both user code and servicing. Set this level when: You are not sure which method in your code was called when the failure occurred. You have an incorrect endpoint configured and the service failed to start because the entry in the reservation store is locked.
    • ActivityTracing: Flow events between processing activities and components. This level allows administrators and developers to correlate applications in the same application domain. Traces for activity boundaries: start/stop. Traces for transfers.

Configuration

See Configuring Web.config for further details.

Activity Tracing configuration

Enabling can be done by simply setting the desired log level value of (e.g. 'switchValue'="Verbose" or higher) Disabling can be done by simply setting the log level value of all three tracers from (e.g. switchValue="Verbose" to switchValue="Off"). There is the possibility to enable only the Activity Tracing log level and this can be done by simply adding the ActivityTracing after the switchValue value(e.g. switchValue="Off, ActivityTracing"), or both log levels can be enabled at the same time(e.g. switchValue="Verbose, ActivityTracing") By default, all switchValues are set to "Off".

Upload of large files

For security reasons we allow the upload of files with a size of 65536 KB (64MB), to increase this size the maxRequestLength attribute in the system.web tag must be adapted.

IC Hint square.pngThe maxRequestLength is handled in KB.
IC Attention.pngThe Configuration Files/Bindings.config must also be adapted otherwise, the upload will fail.
IC Attention.pngIf you are using Windows Internet Information Services (IIS), the maximum upload file size must be reconfigured in IIS otherwise the upload will fail. Configure Microsoft IIS for UBIK

Example Upload of files with 300MB Size

<system.web>
  <customErrors mode="Off"/>
  <httpRuntime maxRequestLength="302700" targetFramework="4.6"/>
  <compilation debug="false" defaultLanguage="c#" targetFramework="4.6"/>
</system.web>



See also