Perhaps my http://www.CodePlex.com/SDMS project may provide some insight for your requirements. I have some blog/webcast links on the home page. The "Unity, WCF and Configuration" webcast shows how,
using my UnityContrib project, you can easily setup your WCF service so that it is resolved via Unity. As you'll see in the webcast you can easily switch between implementation for your service contract with a simple update to the <Unity> section in
the web services Web.Config file.
The only thing was it didn't fall into my vision of having only "1" configuration file to manage for an entire enterprise solution (which I have achieved and plugged into this project). So I added functionality (proof of concept) where I can control
the class that is used by the WCF service from within the main Websites Web.Config file (see referenced link for more details).
Below I show a unit test that exercises the WCF Service. The Presentation Tier has it's own BLL and DAL. The DAL has a "Web Service Reference" and raises an event when data arrives, it is bubbled through the BLL and handled as shown below:
public void MyTestInitialize()
// Subscribe to baseclass MockBootStrapper event
Boot.OnConfigureContainer += OnConfigureContainer;
// Initialize base for unit test use
InitializeBase(this, new TestEventArgs
SolutionName = @"sdms\SDMS.Silverlight\SDMS.Silverlight.Web"
void OnConfigureContainer(object sender, TestEventArgs e)
private ObservableCollection<Employee_Data> employeeList;
public void CanRetrieveListFromService()
IEmployeeProviderBLL bll = Container.Resolve<IEmployeeProviderBLL>();
bll.OnEmployeeEvent += EmployeeEventHandler;
// Call async event to get employee list
// allow process time to set employeeList below
Assert.IsTrue(employeeList.Count > 0);
void EmployeeEventHandler(object sender, EmployeeEventArgs e)
employeeList = e.EmployeeList;