NAV 2009 NavDatabasePasswordException - Dynamics CRM Plugin

Sudheesh
Member Posts: 5
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).
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.
The above code works fine when run from a c# application in the same system.
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.
0
Answers
-
After setting the network credentials, the code started working. I am not clear why default credentials is not working. I will be very happy if someone could share their thoughts
mgmt.UseDefaultCredentials = false;
mgmt.Credentials = new System.Net.NetworkCredential ("Administrator","pass@word1", "LITWAREINC");using System; using System.Collections.Generic; using System.Text; using Microsoft.Crm.Sdk; using Microsoft.Crm.SdkTypeProxy; namespace SendToNAV { using NavWS; public class SendToNAV : IPlugin { public void Execute(IPluginExecutionContext context) { ProjectMgmt mgmt = new ProjectMgmt(); //mgmt.UseDefaultCredentials = true; mgmt.UseDefaultCredentials = false; mgmt.Credentials = new System.Net.NetworkCredential("Administrator","pass@word1", "LITWAREINC"); mgmt.Url = "http://moss:7047/DynamicsNAV/WS/CRONUS_India_Ltd/Codeunit/ProjectMgmt"; mgmt.CreateProject("From CRM"); } } }
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions