Wcf温莎城堡 [英] Wcf Castle Windsor

查看:99
本文介绍了Wcf温莎城堡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

截至上周,我正在使用Wcf设备(windsor 2.5.2)从github存储库获取最新版本.

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)

找不到与绑定WSHttpBinding的端点的方案http匹配的基地址.注册的基址方案为[].

Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [].

这是设置

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());

将所有的windsor物品移回香草服务中,效果很好.

removing all the windsor stuff back to a vanilla service it works fine.

第32行的"Castle.Facilities.WcfIntegration.DefaultServiceHost"中引发了错误

the error is thrown in "Castle.Facilities.WcfIntegration.DefaultServiceHost" on line 32

this.model = model;

谢谢

骨头

推荐答案

似乎正在发生的事情是在安装过程中Castle将开始创建服务,该服务当时没有将基址传递给它(观察) ,我可能会有一点不正确)

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)

我想我唯一的问题是这是注册服务的正确方法吗?" Wiki和演示应用程序显示了与视频中的示例不兼容的不同方式.

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.

这篇关于Wcf温莎城堡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆