Hello all,
I am getting a very strange exception when I simply try to instantiate the AuthenticationClient class. I invoke it with the following:
AuthenticationClient authCLient = new AuthenticationClient();
and I get the following exception:
Could not find default endpoint element that references
contract 'CWS.Authentication' 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.
The main hings I'm doing differently from previous projects are 1) I'm using Visual Studio 2012 instead of 2010, 2) I'm tying into my client's project so I've added the service references to a single project within a solution, 3) I'm calling the web service indirectly from another project which acts as a test harness (since the project I had to add to is a library project and can't be made runnable).
I had looked at the app.config for my project and for one that had worked and I noticed that in the one that worked, it had a whole bunch of extra XML for each binding, i.e.
<binding name="BasicHttpBinding_ContentService" 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="Mtom" 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>
where as my project only had <binding name="BasicBinding_HttpContentService"/>
I tried adding in the extra XML to my app.config but that made no difference. Is there a step that I'm missing somehow???
-Hugh