以下内容无法编译:
DefaultServiceHostFactory.RegisterContainer(Container.Kernel);
Castle 3.0中似乎不存在静态方法 - 我检查了breakingchanges.txt并没有看到列出的内容.
我错过了什么?
4个生产服务器中的一个偶尔会产生大量错误,声称:
此代理不支持方法RunRules,如果方法未使用OperationContractAttribute标记,或者接口类型未使用ServiceContractAttribute标记,则会发生这种情况.
方法"RunRules"是wcf [ServiceContract]接口中的方法之一,它被标记为[OperationContract].
在此错误之前,在同一方法中,偶尔会通过城堡容器获得错误的服务.在我输入更多日志信息以确定原因之后,它突变为当前错误.
这是一个错误发生的Web服务,它会在发生这种情况时尝试通过wcf端点调用Windows服务.这只发生在一台特定的机器上.频率约为每周一次或两周.一旦web服务的回收发生(3小时),错误就会停止.
对我而言,它几乎就像腐败的vtable.只是想知道,你会如何处理这个问题?讨厌要求IT人员在没有可靠证据的情况下开始重新对机器进行成像.
谢谢!
我创建了三个组件.Web站点,WCF服务和包含服务实现的接口的合同程序集.我想使用Castle Windsor在客户端(网站)上为我创建服务,这样我就不必在我希望使用的每个服务的web.config网站中都有一个端点.
我想查看契约程序集并获取命名空间中的所有服务接口.现在,对于每个服务,我在使用容器注册组件时都会遇到以下情况.
container.Register(Component.For<ChannelFactory<IMyService>>().DependsOn(new { endpointConfigurationName = "MyServiceEndpoint" }).LifeStyle.Singleton);
container.Register(Component.For<IMyService>().UsingFactoryMethod((kernel, creationContext) => kernel.Resolve<ChannelFactory<IMyService>>().CreateChannel()).LifeStyle.PerWebRequest);
Run Code Online (Sandbox Code Playgroud)
在我的web.config中我有设置代码.
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="AuthToken" type="MyNamespace.Infrastructure.AuthTokenBehavior, MyNamespace.Contracts" />
</behaviorExtensions>
</extensions>
<behaviors>
<endpointBehaviors>
<behavior>
<AuthToken />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647"></readerQuotas>
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint name="MyServiceEndpoint" address="http://someurl/MyService.svc" binding="wsHttpBinding" contract="MyNamespace.Contracts.IMyService"></endpoint>
</client>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)
我最终得到了几个看起来几乎完全相同的服务端点,当我们部署到客户端机器上时,他们必须设置每个端点的地址,即使每个端点的基本URL都相同.
我希望在我的web.config中有一个基本URL,它通过代码获取,然后使用合同程序集上的反射向容器注册服务.我确实需要上面配置文件中的专门端点行为.
我从哪里开始?WcfFacility看起来很棒但是doco有点缺乏......
如果我有一个PerWebRequest具有与PerThread生活方式的wcf代理依赖关系的对象,那么容器
如果a),那么我应该明确地发布服务以避免泄漏,或者如果b),如果这是它被注入的唯一地方,那么使用PerThread代理是否有任何实际好处?
我对城堡wcf设施登记感到困惑.
我读了一些BasicHttpBinding的博客文章.但是找不到一个清晰简单的样本来设置net.tcp设置.
我想从控制台应用程序托管服务...
我写了这样的东西......你能在这里看到问题吗?
_container = new WindsorContainer();
_container.AddFacility<WcfFacility>();
_container.Register(Component.For<IMembershipService>().ImplementedBy<MembershipService>()
.AsWcfService(
new DefaultServiceModel()
.AddEndpoints(WcfEndpoint
.BoundTo(new NetTcpBinding() { PortSharingEnabled = false })
.At("net.tcp://localhost/MembershipService")
)
.PublishMetadata()
)
);
Run Code Online (Sandbox Code Playgroud) 在IIS中托管的windsor ioc,wcf设施设置下,推荐的raven doc会话和商店的生活方式是什么?
我一直看到这个错误:
Error TempPathInUse (JET_errTempPathInUse, Temp path already used by another database instance)`
Run Code Online (Sandbox Code Playgroud)
这是我的设置:
public class RavenInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
Component.For<IDocumentStore>().ImplementedBy<DocumentStore>()
.DependsOn(new { connectionStringName = "RavenConnectionString" })
.OnCreate(DoInitialisation)
.LifeStyle.Singleton,
Component.For<IDocumentSession>()
.UsingFactoryMethod(GetDocumentSesssion)
.LifeStyle.Transient
);
container.Register(Component.For<IEventSeriesRepository>().ImplementedBy<EventSeriesRepository>().LifeStyle.Transient);
container.Register(Component.For<IEventInstanceRepository>().ImplementedBy<EventInstanceRepository>().LifeStyle.Transient);
container.Register(
Component.For<IProductionCompanyRepository>().ImplementedBy<ProductionCompanyRepository>().LifeStyle.
Transient);
}
static IDocumentSession GetDocumentSesssion(IKernel kernel)
{
var store = kernel.Resolve<IDocumentStore>();
return store.OpenSession();
}
public static void DoInitialisation(IKernel kernel, IDocumentStore store)
{
store.Initialize();
IndexCreation.CreateIndexes(typeof(EventSeries_ByName).Assembly, store);
}
}
Run Code Online (Sandbox Code Playgroud) 我正在开发一个试图利用SOA模式的网站.该服务通过使用外观服务提供简化的API,为主要Web应用程序以及HTML5移动应用程序和本机iPhone和Android应用程序提供服务.
Web应用程序使用Castle WCF Facility使用basicHttpBinding连接到服务.
我觉得性能很慢.特别是如果该网站没有被击中超过半小时.为了解决这个问题,我已经将应用程序池回收策略更改为在应用程序池达到x%的服务器RAM之后进行回收.
我的问题是 - 在这样的设置中托管服务的最佳方式是什么?什么是最好的绑定使用?我是否应该考虑将服务从IIS中移出?我知道net.tcp是最快的绑定使用 - 最好是使用它来托管服务作为Windows服务吗?
干杯
女://
我正在尝试使用一个WcfFacility和IIS 来托管多个服务,我看到一些令人困惑的结果.
这是我的配置:
var baseUri = new Uri(HttpContext.Current.Request.Url.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped));
container.AddFacility<WcfFacility>(f => { f.CloseTimeout = TimeSpan.Zero; }).Register(
Component.For<IAttributeService>()
.ImplementedBy<AttributeService>()
.AsWcfService(
new DefaultServiceModel()
.Hosted()
.AddEndpoints(
WcfEndpoint.ForContract<IAttributeService>().BoundTo(new BasicHttpBinding()).At("Soap11"),
WcfEndpoint.ForContract<IAttributeService>().BoundTo(new WSHttpBinding()).At("Soap12")
)
.AddBaseAddresses(new Uri(baseUri, "AttributeService.svc"))
),
Component.For<ISessionService>()
.ImplementedBy<SessionService>()
.AsWcfService(
new DefaultServiceModel()
.Hosted()
.AddEndpoints(
WcfEndpoint.ForContract<ISessionService>().BoundTo(new BasicHttpBinding()).At("Soap11"),
WcfEndpoint.ForContract<ISessionService>().BoundTo(new WSHttpBinding()).At("Soap12")
)
.AddBaseAddresses(new Uri(baseUri, "SessionService.svc"))
),
Component.For<ISampleService>()
.ImplementedBy<SampleService>()
.AsWcfService(
new DefaultServiceModel()
.Hosted()
.AddEndpoints(
WcfEndpoint.ForContract<ISampleService>().BoundTo(new BasicHttpBinding()).At("Soap11"),
WcfEndpoint.ForContract<ISampleService>().BoundTo(new WSHttpBinding()).At("Soap12")
)
.AddBaseAddresses(new Uri(baseUri, "SampleService.svc"))
)
);
Run Code Online (Sandbox Code Playgroud)
当我去使用WCF测试客户端来检查时,似乎每个服务下可用的方法都是该服务和我之前所有服务的组合.例:

我做错了吗?你不能WcfFacility多次添加,并在互联网上四处寻找,我似乎无法找到一个人在一个设施中托管多个服务的例子.
有任何想法吗?
wcffacility ×8
wcf ×7
c# ×2
castle ×1
net.tcp ×1
production ×1
ravendb ×1
wcf-endpoint ×1
windsor-3.0 ×1