Hi All,
I am getting the following exception in event viewer while trying to execute a small piece of code from a Dynamics CRM Plug-in (plug-in registered as Administrator).
Event Type: Error
Event Source: MicrosoftDynamicsNAVServer
Event Category: None
Event ID: 0
Date: 2/21/2009
Time: 7:35:38 PM
User: N/A
Computer: <computer Name>
Description:
User:
Type: Microsoft.Dynamics.Nav.Types.NavDatabasePasswordException
SuppressMessage: False
FatalityScope: None
Message: The user ID and password are invalid. Try again.
StackTrace:
at Microsoft.Dynamics.Nav.Runtime.NavRuntimeAdapter.ErrorHandler(Int32 errorCode, Int32 errorNumber, Int32 moduleNumber, String errorText)
This same code runs fine when executed from a c# program.
This is a single computer installation. I am running Demo Installation of Dynamics NAV 2009 with Dynamics CRM 4.0. I have logged on to CRM using Administrator account. All services including SQL Server, Dynamics NAV and Dynamics CRM are running in Administrator account. I tried changing everything to LOCAL SERVICE and restarted the services. But no help. I am using my partner license.
the code unit that consumes webservice is as follows.
ProjectMgmt mgmt = new ProjectMgmt();
mgmt.UseDefaultCredentials = true;
mgmt.Url = "http://localhost:7047/DynamicsNAV/WS/CRONUS_India_Ltd/Codeunit/ProjectMgmt";
mgmt.CreateProject("From CRM");
The above code works fine when run from a c# application in the same system.
Answers
mgmt.UseDefaultCredentials = false;
mgmt.Credentials = new System.Net.NetworkCredential ("Administrator","pass@word1", "LITWAREINC");