.NET web application connecting to NAV Web Services (Login i

mnash_acora
Member Posts: 3
Hi All,
Relatively new to NAV 2015, I’ve created a SharePoint Portal that connects to NAV via webservices. The below snippet is my current connection method to NAV which works well.
The dedicated NAV login account details are stored in a SharePoint List, this works fine , my question is around the approach, as I’m lead to believe using a dedicated User account is not allowed for internal users due to Multiplexing (believe it’s called).
Is there another way to connect i.e. passing a username & there web service access key?
Many Thanks.
// Calls Function from The CoreFunctions Class File to get the login details & stuff in an array
ArrayList Details = CF.NAVLoginDetails();
// The Web Service URL – Stored in SharePoint
string serviceUri = CF.NAVWebServiceURL();
//Setting up NAV Conection
DataServiceContext context = new DataServiceContext(new Uri(serviceUri));
NAV nav2 = new NAV(new Uri(serviceUri));
// Setting NAV Credentials (Username,Password,Domain
nav2.Credentials = new System.Net.NetworkCredential(Details[1].ToString(), Details[2].ToString(), Details[0].ToString());
//Query
IQueryable Invoices;
Invoices = from c in nav.TPostedSalesOrder
orderby c.Line_No ascending
select c;
//Loop through
foreach (CustomerPortal.ServiceReference1.TPostedSalesOrder Invoice in Invoices)
{
// Do XYZ
}
Relatively new to NAV 2015, I’ve created a SharePoint Portal that connects to NAV via webservices. The below snippet is my current connection method to NAV which works well.
The dedicated NAV login account details are stored in a SharePoint List, this works fine , my question is around the approach, as I’m lead to believe using a dedicated User account is not allowed for internal users due to Multiplexing (believe it’s called).
Is there another way to connect i.e. passing a username & there web service access key?
Many Thanks.
// Calls Function from The CoreFunctions Class File to get the login details & stuff in an array
ArrayList Details = CF.NAVLoginDetails();
// The Web Service URL – Stored in SharePoint
string serviceUri = CF.NAVWebServiceURL();
//Setting up NAV Conection
DataServiceContext context = new DataServiceContext(new Uri(serviceUri));
NAV nav2 = new NAV(new Uri(serviceUri));
// Setting NAV Credentials (Username,Password,Domain
nav2.Credentials = new System.Net.NetworkCredential(Details[1].ToString(), Details[2].ToString(), Details[0].ToString());
//Query
IQueryable Invoices;
Invoices = from c in nav.TPostedSalesOrder
orderby c.Line_No ascending
select c;
//Loop through
foreach (CustomerPortal.ServiceReference1.TPostedSalesOrder Invoice in Invoices)
{
// Do XYZ
}
0
Comments
-
Have you found an answer to this inquiry?
I too am trying to find a way to call the web service using the username and web service key.
When I pass the web service key in place of the password, it returns and unauthorized 401 page.0 -
sadly no I still have the same issue as yourself, I've posted this around various forums but still no answer.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