c# - Can't find WCF end points -
i trying consume wcf end point .net class library project. added service references client project. following client
try { serviceresult svcresult; using (myserviceclient myclient = new myserviceclient()) { svcresult = myclient.dosomething(param1, param2); } } catch (exception ex) { }
my app.config file looks follows
<system.servicemodel> <bindings> <wshttpbinding> <binding name="wshttpbinding_imyservice" /> </wshttpbinding> </bindings> <client> <endpoint address="http://localhost:1234/mywcfservices/myservice.svc" binding="wshttpbinding" bindingconfiguration="wshttpbinding_iauthenticationservice" contract="myservice.imyservice" name="wshttpbinding_imyservice"> <identity> <dns value="localhost" /> </identity> </endpoint> </client> </system.servicemodel>
but whenever try initialize service client following error
could not find default endpoint element references contract 'myservices.imyservices' in servicemodel client configuration section. might because no configuration file found application, or because no endpoint element matching contract found in client element.
even though application adds endpoint reference app.config default, tried copying web.config(as suggested in q&a forums) , running client still not initialize , still cannot find end-point. missing here?
i have feeling put config in output folder of class library project, should put in config file of host using it. console / desktop app / web app.
Comments
Post a Comment