c# - Cannot consume WCF service in desktop application -



c# - Cannot consume WCF service in desktop application -

i created wcf service has 1 way (void) method.

when create new windows forms application, can add together service reference , phone call method no problems.

when add together reference actual project need on, reference doesn't appear , error cannot find namespace shows.

so while adding service reference, in advanced removed reuse types check box , service there when phone call code error on line initializes service:

var smsservice = new smswebmethod.serviceclient();

error:

could not find default endpoint element references contract 'smswebmethod.iservice' in servicemodel client configuration section. might because no configuration file found application, or because no endpoint element matching contract found in client element.

here <system.servicemodel> section of app.config file

<system.servicemodel> <bindings> <basichttpbinding> <binding name="basichttpbinding_iservice" /> </basichttpbinding> </bindings> <client> <endpoint address="url/service.svc" binding="basichttpbinding" bindingconfiguration="basichttpbinding_iservice" contract="smswebmethod.iservice" name="basichttpbinding_iservice" /> </client> </system.servicemodel>

ok seems there config file overriding app.config.

c# asp.net web-services wcf asp.net-4.0

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -