<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ep1" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:57582/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="ep1" contract="ServiceReference1.IService1"
name="ep1" />
</client>
</system.serviceModel>
</configuration>
this is my configuration for client-endpoint in autogenerated app.config file but still i get following error: Could not find endpoint element with name 'ep1' and contract 'ServiceReference1.IService1' 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 am consuming the service using ::
Service1Client wcf = new Service1Client("ep1")
Its working now.i just defined the client endpoint in web.config of whole solutions from the autogenerated app.config file.its working now.
[yourappname].exe.config
file present in the bin folder? – Andras Zoltan