1
I created a simple web service that sums up two numbers and returns the result. O IIS
left configured as windows authentication enabled and the other 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);
It’s made me wrong:
An unhandled Exception of type 'System.ServiceModel.Security.Messagesecurityexception' occurred in mscorlib.dll
Additional 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. It would have to catch the current user of who is calling the web service?
Put your Web.Config too.
– Jean Gustavo Prates
The same thing that’s happening to you: 'System.ServiceModel.Security.Messagesecurityexception' in WCF
– Marconi
I have this <Binding> <security mode="Transportcredentialonly"> <transport clientCredentialType="Ntlm" proxyCredentialType="None" Realm="" /> <message clientCredentialType="Username" algorithmSuite="Default" /> </security> </Binding>
– Ichihara
I got you guys
– Ichihara