Im developing a project that calls multiple methods of web services from Dynamics Nav. It uses a SOAP request and sends an response xml to do the call.
I'm unable to authenticate to the web service as I get the following response:
- response {StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Date: Thu, 31 Aug 2017 08:12:15 GMT Server: Microsoft-HTTPAPI/2.0 WWW-Authenticate: Negotiate Content-Length: 0 }} System.Net.Http.HttpResponseMessage
My sample of credentials code is:
var credentials = Encoding.ASCII.GetBytes(usuarioText + ":" + passText);
client.DefaultRequestHeaders.Authorization = new
AuthenticationHeaderValue("Windows", Convert.ToBase64String(credentials));
I need windows authentication for calling the nav service, I think I'm doing something wrong sending the credentials...