WCF Client Reference
-
I have a service all working fine. I have a client, say for arguments sake, it has 2 assemblies - View and BLL Now in the BLL i reference the service and expose a wrapper for one of the service methods (it just returns a bool and is called IsAlive()) that the View can see, but the view cant use IsAlive() unless it refereneces the service as well. Is there any way i can get round this? the error i get is System.InvalidOperationException: Could not find default endpoint element that references contract 'xxxxxxxx' 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 contract could be found in the client element..
-
I have a service all working fine. I have a client, say for arguments sake, it has 2 assemblies - View and BLL Now in the BLL i reference the service and expose a wrapper for one of the service methods (it just returns a bool and is called IsAlive()) that the View can see, but the view cant use IsAlive() unless it refereneces the service as well. Is there any way i can get round this? the error i get is System.InvalidOperationException: Could not find default endpoint element that references contract 'xxxxxxxx' 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 contract could be found in the client element..
You shouldn't need to reference the service in your UI but you would need to have the endpoints defined in the config file for your UI. Are you saying that even with the endpoints declared in the UI config it still doesn't work?
-
You shouldn't need to reference the service in your UI but you would need to have the endpoints defined in the config file for your UI. Are you saying that even with the endpoints declared in the UI config it still doesn't work?
-
Thanks for your reply. It does work if i just have the config file. I was kind of hoping not to have to decalare it in the UI. so that other UI's that use the same BLL dont have to know about the config file.
As both the UI and the BLL will run in the same process only one config file will be loaded so you won't get any settings from the BLL config file. You could get around it by creating your own XML file in the BLL which gets deployed with the compiled dll and create the end points etc yourself programatically but that sounds like more trouble than its worth.
-
As both the UI and the BLL will run in the same process only one config file will be loaded so you won't get any settings from the BLL config file. You could get around it by creating your own XML file in the BLL which gets deployed with the compiled dll and create the end points etc yourself programatically but that sounds like more trouble than its worth.