Error 401 when trying to acces NAV 2013 Web Service
AntoineV
Member Posts: 3
Hi!
First of all, sorry if the question have already been posted, but I didn't find anything that could help on the forum.
I'm trying to access NAV 2013 Web service in a Visual Studio C# application for one of our customer.
Here is the setup of our servers :
- SQL Server : Server1
- NAV 2013 Tier Service Server : Server2. We used our active directory administrator account to start the service.
When I want to add a service reference to my project, an authentication window pop up and ask me for credentials.
Even if I provide the correct credentials (our active directory administrator account, the same service account used for NAV2013 tier service), this window pop up in loop and I can't do anything.
If I press cancel on this window, I got an error message that says : "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate’" and HTTP 401 error.
I've tried to enter the web service URL in IE on my computer, a window asking for credentials opens (like in VS) and when I press ok, I got an HTTP 400 error.
When I do this on Server2, there is no problem and I can see all the page/codeunits that I've published.
I also tried to use the network account on Server2, but this time I get an SQL error on both computer, and I got a new entry in SQL Server log (ID 18456 : "Login failed for user Reason: Token-based server access validation failed").
Thanks for your help/answers!
First of all, sorry if the question have already been posted, but I didn't find anything that could help on the forum.
I'm trying to access NAV 2013 Web service in a Visual Studio C# application for one of our customer.
Here is the setup of our servers :
- SQL Server : Server1
- NAV 2013 Tier Service Server : Server2. We used our active directory administrator account to start the service.
When I want to add a service reference to my project, an authentication window pop up and ask me for credentials.
Even if I provide the correct credentials (our active directory administrator account, the same service account used for NAV2013 tier service), this window pop up in loop and I can't do anything.
If I press cancel on this window, I got an error message that says : "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate’" and HTTP 401 error.
I've tried to enter the web service URL in IE on my computer, a window asking for credentials opens (like in VS) and when I press ok, I got an HTTP 400 error.
When I do this on Server2, there is no problem and I can see all the page/codeunits that I've published.
I also tried to use the network account on Server2, but this time I get an SQL error on both computer, and I got a new entry in SQL Server log (ID 18456 : "Login failed for user Reason: Token-based server access validation failed").
Thanks for your help/answers!
0
Answers
-
Hi,
If you use a specific user to run NAV Server Service then you have to create a delegation as explained here
http://msdn.microsoft.com/en-us/library/jj551742%28v=nav.71%29.aspx
Also make sure that the user you use to run NAV Server Service has enough permissions as explained here:
http://msdn.microsoft.com/en-us/library/hh166150%28v=nav.71%29.aspx
This is only necessary if you use a dedicated user for NAV Server service.
If you change the user to be Network Service it will work. This is probably the best way to start. Later you can use a dedicated user.
I hope this helps.
Thanks.0 -
Hi,
Thanks for your answer.
Yesterday, I forgot to mention that I already tried to setup delegation (with the MSDN link) for the service account, but with no sucess.
Today I tried again with the network service account as you said, and I found something in the SQL Server log : the event with the ID 18456 came with the message "Login failed for user Domain\ComputerName$".
So I created this user in SQL security, gave him access to the NAV 2013 database, and now I can access my web service from my computer.
I will try to setup delegation later, if it's working in this configuration, I'll procede like this for the moment.
Again, thanks for your help!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 331 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
