WcfFacility
1 つのサービスと 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"))
)
);
これを確認するために WCF テスト クライアントを使用すると、各サービスで使用できるメソッドは、そのサービスとその前に作成したすべてのサービスを組み合わせたものであるかのように見えます。例:
私はこれを間違っていますか?複数回追加することはできずWcfFacility
、インターネットを調べてみると、誰かが 1 つの施設で複数のサービスをホストしている例が見つからないようです。
何か案は?