I am calling a WCF service from console app, I do not have any control on WCF service.
this console app works fine on my development system and one 2008 server, When I move it to server running windows 2012 it gives error The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'
app config file contains
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ServiceNameSoap" maxBufferSize="5242880" maxReceivedMessageSize="5242880">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://someCompanyurl.com/ServiceName" binding="basicHttpBinding" bindingConfiguration="ServiceNameSoap" contract="ServiceName.ServiceNameSoap" name="ServiceNameSoap"/>
</client>
actual code is
ServiceNameSoapClient proxy = new ServiceNameSoapSoapClient();
proxy.ClientCredentials.Windows.ClientCredential.Domain = connStringParts[DOMAIN];
proxy.ClientCredentials.Windows.ClientCredential.UserName = connStringParts[USER_NAME];
proxy.ClientCredentials.Windows.ClientCredential.Password = connStringParts[PASSWORD];
proxy.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Delegation;
RequestHeader soapHeader = new RequestHeader();
soapHeader.clientApplicationName = ConfigurationManager.AppSettings["clientApplicationName"];
ServiceNameRequestCollection request = new ServiceNameRequestCollection();
adding some flags to request
Response = proxy.Method(soapHeader, request, out Response);
I have searched extensively, haven't fond any solution .
any setting missing or configuration missing on 2012 server?
have tried changing Ntlm to Windows and Vice versa . same error, negotiate changes to ntlm in error message.
Thanks