I created a simple web service that makes a sum of two numbers and returns the result. The IIS
I have configured windows authentication enabled and the others disabled.
Code:
ServiceReference2.TesteSomaSoapClient a = new ServiceReference2.TesteSomaSoapClient();
a.ClientCredentials.UserName.UserName = @ "Dominio\user";
a.ClientCredentials.UserName.Password = "senha";
var b = a.Soma(1, 1);
You have given me the error:
An unhandled exception of type 'System.ServiceModel.Security.MessageSecurityException' occurred in mscorlib.dllAdditional information: The HTTP request is not authorized in the 'Anonymous' client authentication scheme. The authentication header received from the server was 'Negotiate, NTLM'.
One more detail, I will not be able to send the user and password. Would you like to catch the current user of who is calling the web service?