Error when using the Ektron database connection string in an MVC environment

  • Updated

Some users may notice when upgrading an MVC site based of the Synergy 2011 MVC Sample (created on Ektron 8.6) to Ektron 9.1 that they are receiving errors similar to the following when using the select Ektron APIs:

[CommunicationException: An error occurred while receiving the HTTP response to http://mysite/workarea/services/SiteService.svc.

For security reasons, Ektron restricts access to the database from a 3-tier presentation layer or an MVC application. Some Ektron APIs check for the request information connecting string settings to see if it is null or populated. By adding the Ektron.DbConnection connection string, the database connection name fills the dbconnection properties and will initiate if there is one.  

To avoid these errors do not add the Ektron database connection string in your MVC applications web.config file. The recommended approach is to use the MVC project as the presentation layer in a 3-Tier deployment and access the application layer via the ek_ServicesPath instead of the database directly.

If interested in creating a MVC application as a a presentation layer, copy the following items from the 3-Tier Starter site found C:\Program Files (x86)\Ektron\CMS400v91\startersites\3TierMin:

  • web.config
  • ektron.cms.framework.unity.config

and add the assembly references to the MVC project from the bin folder and point the services path to the Ektron site.

For more information on a 3-Tier deployment click here.