I have one console application (i.e. Project1/Solution1).I am calling one web service (.asmx) from console application which is in separate project (i.e. Project1/Soloution2) Through single web method there is call to two different business class methods (i.e. Project2/Soloution2) which in turn call two different external wcf services. I am programmatically creating the endpoint and binding elements to call the wcf methods.
EndpointAddress ed = new EndpointAddress(rtd.WebServiceUrl);
BasicHttpBinding binding = new BasicHttpBinding("BasicHttpBinding_TestService");
ServiceClient client = new ServiceClient(binding, ed);
string response = client.Getdetails(string input1, string input2)
I am getting error "No elements matching the key 'BasicHttpBinding_TestService’ were found in the configuration element collection" although I have added this configuration in my app.config file.
Section in my app.config file
<binding name="BasicHttpBinding_TestService" closeTimeout="00:00:05"
openTimeout="00:00:05" receiveTimeout="00:00:15" sendTimeout="00:00:05"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2047487456" maxBufferPoolSize="524288" maxReceivedMessageSize="2047487456"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2047487456"
maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
Even I added this in the web.config file where my web method resides (i.e. Project1/Soloution2) and in the calling console application's app.config file.