castle windsor - How can I register a Wcf Service contract without knowing the implementation -
without castle windsor write:
var channelfactory = new channelfactory<icredentialservice>("default"); icredentialservice credentialservice = channelfactory.createchannel();
how can register wcf service contract castle windsor api?
add castle windsor wcf integration facility nuget package project
add wcffacility
container:
container.addfacility<wcffacility>();
then, tell container provide wcf client when have dependency on service interface:
container.register( component.for<icredentialservice>() .aswcfclient(wcfendpoint.fromendpoint("endpointname")));
it use named endpoint in .config retrieve settings endpoint.
whenever class resolved container has constructor dependency on icredentialservice
container inject wcf client.
Comments
Post a Comment