Trying to register a WCF client with Castle WcfIntegration 3.0; is there anything wrong with the following syntax?
Container.Kernel.Register( Component.For(serviceType) .AsWcfClient(new DefaultClientModel { Endpoint = WcfEndpoint .FromConfiguration( serviceType.Name. Substring(1) + "Client") }) .LifeStyle.Is(lifestyle));
The problem I'm having is when in the context of a WCF service operation, ServiceSecurityContext.Current is null. This did not happen in the old version of Castle (1.0.3.0). Trying to understand if it's something I'm doing wrong or if some change to Castle mandates some other change to get ServiceSecurityContext.Current to populate as it did before.
thanks
For the record, here is the syntax I used that worked in the end. (Given the need for more Castle documentation, I figure any example of working syntax couldn't hurt)!
Also for the record, the problem of the ServiceSecurityContext.Current being null was happening for a different reason.
I had made a change to a config file, which I thought was insignificant (because certain classes appeared to be obsolete), but which turned out to be very significant (and those classes were very much needed).
The "component" node in the castle config file looked like this:
The "FederatedServiceHostBuilder" class:
and the (crucial) FederatedServiceHost class:
So the bottom line is, it was the "FederatedServiceCredentials.ConfigureServiceHost(this)" line that was missing, and thus causing my ServiceSecurityContext.Current to be null.