We have a .Net WebApi Calling a Navision Soap service.
It works... except for sometimes, then suddenly for a couple of hours it starts returning Unauthorized, and then it returns back to normal... and starts working...
As the "Error info" describes, the scheme seems to be correct.
It is located on 2 different servers on the network(Read that having the 2 services on the same server, could cause problems).
SOAP IIS:
- Anonymous Auth and Windows Auth is enabled.
- SSL Certs are up to date
- Nothing in Event Viewer to indicate an error.
Client/BasicHttpBinding:
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
client.ClientCredentials.Windows.ClientCredential.Domain = "domain.dk";
client.ClientCredentials.Windows.ClientCredential.UserName = "username";
client.ClientCredentials.Windows.ClientCredential.Password = "password";
Error message:
The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate'.
InnerException: The remote server returned an error: (401) Unauthorized.