I am trying to connect to a WCF service but when I do I get this error:
The HTTP Request is unauthorized with client authetication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="ServiceGateway"'.
I know I do authentication as I set the client credentials on my WCF client:
new wcfClient(enpointconfigurationName, url)
{
ClientCredentials =
{
UserName =
{
UserName = "yyy",
Password = "zzz"
}
}
}
Edit
I have this WCF configuration in the web.config:
<client>
<endpoint address="xxx" binding="basicHttpBinding" bindingconfiguration="myBinding" contract="yyy" name="myName" />
</client>
<basichttpbinding>
<binding name="myBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01: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>