views:

144

answers:

1

Hi, I have application in C# that consume Java WS. Everything worked fine until WS was configured to use authentication. Now I should user login i password to execute methods from WS but I'm not sure how to do it. I've try

var client = new MyBeanClient();
                    client.ClientCredentials.UserName.UserName = "admin";
                    client.ClientCredentials.UserName.Password = "";
                    client.addConsumer("whatever", "", "", "");

But I get SecurityMessageException-{"The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'."} InnerException - (WebException) - {"The remote server returned an error: (401) Unauthorized."}.

What's wrong?

Thanks

A: 
Darin Dimitrov
Unfortunately on client there is no Credentials field. There is only ClientCredentials property but it's readonly :/ Also client doesn't have property Url :/
arek
Still have the same problem :/ SecurityMessageException :/
arek
Hi,Thank you for the answer. Could you please tell me what should I write as "DOMAIN" ??
arek
The name of the domain your account belongs to. In order for NTLM authentication to work you need to have an Active Directory setup.
Darin Dimitrov
I'm not sure why I have to use Domain account ?
arek
Do I need name of the account configured on server which contains this WS ?
arek