Configuring WCF for Multiple IIS Host Identities in Sueetie

With Sueetie v4.0 shaping up to be a solid Social Media Platform for the Enterprise, I needed to be sure Sueetie could support corporate sites that support multiple IIS host names. An example would be a site accessed both externally and internally, externally at, say, and internally at http://coolcompanynet.

WCF is able to support only a single base address out of the box, and errors to the server Event Log would be generated for any site whose identity does not conform to the base address specified in the Sueetie web.config’s WCF settings.  That won’t be an issue with Sueetie v4.0.

To configure Sueetie to support WCF services in a multi-host environment we’re going to make modifications to two files only, SueetieService.svc and the web.config.


Sueetie Premium Edition includes a special "ServiceHostFactory" class that modifies how WCF Service Hosts are created. We’re going to specify that Service Host Factory class in SueetieService.svc, located at /util/services/SueetieService.svc. We’re going to add a single "Factory" element to our @ServiceHost statement. Add it exactly as you see below.

<% @ ServiceHost Language="C#" 
	Factory="Sueetie.Components.SueetieServiceHostFactory" %>


We’re going to modify the web.config WCF settings to support multiple host endpoints. Replace the corresponding lines in your web.config with the following.

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
	multipleSiteBindingsEnabled="true" />
<service name="SueetieService" 
<add baseAddress=""/>
<add baseAddress=""/>
	<endpoint behaviorConfiguration="SueetieServiceAspNetAjaxBehavior" 
			binding="webHttpBinding" contract="SueetieService" />

"" and "" or any additional hosts will be replaced by your site’s hosts.

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.