WCF client using basic HTTP authentication
- by AZ
I'm trying to connect to a service that uses basic HTTP authentication.
I've configured my binding like this
<bindings>
<basicHttpBinding>
<binding name ="binding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
and i'm setting the credentials like this:
client.ClientCredentials.UserName.UserName = Settings.UserName;
client.ClientCredentials.UserName.Password = Settings.Password;
Sill when i make a request i get a "The HTTP request is unauthorized with client authentication scheme 'Basic'" fault back.
What am i doing wrong? (i don't have control over the service so all solutions must relate to the client configuration)