I have created a web application , which calls SOAP web service of Sales Quote Page of NAV. I developed application on my local computer , actually below credentials works well in my local. But when i move to server, web service call returns with an error. The only difference between my local and remote server is , i can use local windows administrator account in my local but in remote server, i need to use NavUserPassword and add basic authorization header to web service call. I have the account but always received same error.
Can anybody help with this issue?
BasicHttpBinding _binding = new BasicHttpBinding();
_binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
_binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
EndpointAddress endpointAddress = new EndpointAddress(new Uri("WEB SERVICE URL"));
using (Sales_Quote_PortClient salesQuote_PortClient = new Sales_Quote_PortClient(_binding, endpointAddress))
salesQuote_PortClient.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential(username, pass,domain);
salesQuote_PortClient.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;