WcfFacility Lock - Service Behavior

How to use WcfFacility Lock and use standard Wcf file settings?

If I register myself like this:

container.Register( AllTypes.Pick() .FromAssemblyNamed("{ServicesAssembly}") // <-- service assembly here .If(type => type.Name.EndsWith("Service")) .WithService.FirstInterface() .Configure(configurer => configurer.LifeStyle.Transient) .Configure(configurer => configurer.Named(configurer.Implementation.Name)) .Configure(configurer => configurer.ActAs(new DefaultServiceModel())) ); 

I get the following error:

The service '{name}' has zero application endpoints (no infrastructure).

If I leave:

 .Configure(configurer => configurer.ActAs(new DefaultServiceModel())) 

it seems that the behavior in the config is ignored.

What is the correct use here?

+4
source share
2 answers

OK, it turned out :)

I register like this:

 container.Register( AllTypes.Pick() .FromAssemblyNamed("{ServicesAssembly}") // <-- service assembly here .If(type => type.Name.EndsWith("Service")) .WithService.FirstInterface() .Configure(configurer => configurer.LifeStyle.Transient) .Configure(configurer => configurer.Named(configurer.Implementation.Name)) .Configure(configurer => configurer.ActAs(new DefaultServiceModel().Hosted())) ); 

Hosted () indicates that I am hosting services; otherwise it seems that the WCF Facility will try to host them, resulting in port conflicts.

So the problem was that the service name in the configuration file has the fully qualified name of the implementation type. If no one gets an error indicating something along lines without specific endpoints. Therefore, the service name does not match the name specified in windsor.

+6
source

You are almost there.

You need the following:

 .ActAs(new DefaultClientModel(WcfEndpoint.FromConfiguration( <<key In Configuration>> ))); 
0
source

Source: https://habr.com/ru/post/1307776/


All Articles