Reputation: 1
My application is trying to consume a WebService for which i have a WSDL file. So, i generated an interface from that using SvcUtil.exe. I am using that in my class as below :
namespace ApplicationUsage
{
public class Usage
{
private readonly IExportService _exportServiceProxyClient;
public Usage(IExportToNavisionService _exportServiceProxyClient)
{
_exportServiceProxyClient= exportServiceProxyClient;
}
}
I am injecting the "IExportService" as :
Component.For<IExportService >() .AsWcfClient(DefaultClientModel.On(WcfEndpoint.FromConfiguration("exportServiceProxyClient")));
My issue is that i am forced to use the Endpoint name in the app.config same as the property name ("exportServiceProxyClient") in the class constructor ("Usage") where the instance to be injected. I dont think that it is a good idea. If i dont do this, i get an exception :
**Could not find endpoint element with name 'exportServiceProxyClient' and contract 'IExportService ' in the ServiceModel client configuration section.
This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.**
I dont know how to get around this issue. Why Windsor wants that the endpoint name should be same the variable name in the constructor for the class where it is being injected.
Can anybody help?
Upvotes: 0
Views: 248