问题
I am using the Wcf Facility, (windsor 2.5.2) latest version from github repo as of last week.
how ever it is not working throwing the following error (when the service starts up)
Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [].
here is the setup
var container = new WindsorContainer();
container.AddFacility<WcfFacility>()
.Register(
Component.For<IUnitOfWork>().ImplementedBy<UnitOfWork>().LifeStyle.PerWcfOperation(),
Component.For<Session>().ImplementedBy<Session>().LifeStyle.PerWcfOperation(),
Component.For<IService1>().ImplementedBy<Service1>().AsWcfService(new DefaultServiceModel()).LifeStyle.PerWcfOperation());
removing all the windsor stuff back to a vanilla service it works fine.
the error is thrown in "Castle.Facilities.WcfIntegration.DefaultServiceHost" on line 32
this.model = model;
thanks
bones
回答1:
What seemed to be happening, was on setup Castle would start to create the service, which at that point did not have the base address being passed to it (observation, I could have this a little incorrect)
i found another post where the developer used
Component.For<IService1>().ImplementedBy<Service1>().ActAs(new DefaultServiceModel().Hosted()).LifeStyle.PerWcfOperation()
it seems to work (I have even taken a quick video)
I guess the only question i have "is this the correct way of registering a service?" the wiki and demo app show different ways which do not work with the example in the video.
来源:https://stackoverflow.com/questions/5394022/wcf-castle-windsor