Setting up a custom web server for reporting
Published 02 January 2013
This feature is available in SmartAssembly Professional only.
You can set up a custom web server for error reporting and feature usage reports. This changes SmartAssembly, so that reports are sent to a web service running on your own server, rather than the default one operated by Redgate.
Most users of SmartAssembly do not need a custom web server. However, if you build applications for internal use in your company, and your company has a firewall that would prevent communication with the Redgate-hosted web service, you will need to use a custom web server.
The custom web server is distinct from the SQL Server. The custom web server hosts the web service to which reports are sent before they are downloaded to your SQL Server or SQLite database file.
The role of the web service for error reports: | The role of the web service for feature usage reports: |
To set up a custom web server:
- Download the zip archive containing the custom web service files.
- Create a directory for SmartAssembly on your web server.
For example, http://www.myWebServer.com/saWebServices/. - Copy the three .asmx files (Login.asmx, Reporting.asmx, and UploadReportLogin.asmx) and the Web.config file from the zip archive to the directory you just created.
- Copy ClientAccessPolicy.xml into the root directory of your web server.
- Open the /bin/ directory within the .zip archive.
- Copy SmartAssembly.WebService.dll and log4net.dll into the /bin/ directory of your web server.
If the /bin/ directory does not already exist, create it in the root directory of your web server. - Verify that the first part of the setup is correct by calling the web service from your browser: http://www.myWebServer.com/saWebServices/UploadReportLogin.asmx.
Confirm that you are displaying the standard web service welcome page. Create a folder on the web server, which is not publicly accessible.
This folder is where reports are stored when they are uploaded. The web service must have write access to the folder and its sub-folders.
In the example below, the physical path for the reports folder is c:\MyCustomWebServer\. Edit the server's web.config file to add this location:<configuration> ... <appSettings> <add key="ReportsFolder" value="c:\MyCustomWebServer\" /> </appSettings> ... </configuration>
- In SmartAssembly, click Options. Under Custom web server, select I want to use my own web server. Enter the URL of the directory which contains the web service.
- Test your new web service.
Troubleshooting the custom web service
The custom web service logs any errors that occur by default. The error logs are stored on your web server in the directory where the SmartAssembly web service was installed.
The logs are created using log4net. For information about how to configure logging, see Configuration in the log4net manual.
Disabling error logging
If required, you can disable error logging in the custom web service. To do this:
- On the web server, navigate to the directory where the SmartAssembly web service was installed.
- Open Web.config in an XML editor.
- Change
<level value="ALL">
to<level value="OFF">
.