Service Web avec l'Authentification Windows avec du Savon Client

J'ai besoin d'accéder à un service web à partir d'un c# formes app.

Le webservice besoins de l'Authentification Windows.

J'utilise le code suivant:

ServiceDeskSoapClient sd = new ServiceDeskSoapClient();
sd.ClientCredentials.UserName.UserName = @"mydomain\myusername";
sd.ClientCredentials.UserName.Password = "mypassword";
sd.MyMethod();

Mais obtiens l'erreur suivante:

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.

Comment puis-je définir correctement les informations d'identification de sorte qu'il utilise l'authentification windows, pas anonyme?

OriginalL'auteur Ben | 2011-10-22