My solution was to use a generic typed factory facility (e.g. http://thesenilecoder.blogspot.com/2012/04/ioc-windsor-typedfactoryfacility-and.html)
The factory only consists of the following interface:
public interface IServiceFactory
{
T Create<T>(ApiRequestModel request) where T : IService;
void Release(IService service);
}
And here's how it gets installed to the container:
container.AddFacility<TypedFactoryFacility>();
container.Register(
Component.For<IServiceFactory>().AsFactory(),
Classes.FromThisAssembly().BasedOn<IService>().LifestylePerWebRequest());
That gets injected into the API controller and allows me to create generic types. I used reflection to resolve the generic type before I went to the factory.
Type serviceType = Assembly.Load("TestProject").GetType("TestClass");
MethodInfo factoryMethod = _serviceFactory.GetType().GetMethod("Create").MakeGenericMethod(serviceType);
IService instance = (IService)factoryMethod.Invoke(_serviceFactory, new object[] { request });