Calling Webservice from another webservice
Lefteyed
Member Posts: 43
Hey guys
I have an issue with calling a webserivce within NAV from another webservice.
The setup is like this:
There is a Webshop that users can login to. Users can be either Danish, German, Swedish or others.
There is a dataport set up to access the main company thorough a webservice (codeunit - Function "Process").
This codeunit checks which county the users is from and then calls a webservice (same codeunit - Function "Process2") to the correct company.
The issue is when calling this second webservice I get an 401 error:

I have an issue with calling a webserivce within NAV from another webservice.
The setup is like this:
There is a Webshop that users can login to. Users can be either Danish, German, Swedish or others.
There is a dataport set up to access the main company thorough a webservice (codeunit - Function "Process").
This codeunit checks which county the users is from and then calls a webservice (same codeunit - Function "Process2") to the correct company.
The issue is when calling this second webservice I get an 401 error:

0
Best Answers
-
401 means that the authorisation failed.
Your WebService-request must be authorised with Username and Password.My blog - https://www.HannesHolst.com/5 -
Could this be a double hop issue? The fact that is cannot authenticate the second call to the Web Service with the credentials you pass in the first call?5
-
Does the account which is used to run the NAV web service have a windows login with sufficient rights in the NAV database?5
-
When calling the first webservice there was no problem with AD user.
Tried to set default user when calling the next webservice and tried without setting any user (thinking that it will use the user already log in).
But now I'm setting the user credentials for the user to the webservice and then I get this error instead:
0 -
Mismatch in our wsdl from test enviorment to customers enviorment was the cause of error with "The target principal name is incorrect".
Everything seems to work fine by now.
0
Answers
-
Are both webservices within the same NAV instance/database?0
-
Yes0
-
401 means that the authorisation failed.
Your WebService-request must be authorised with Username and Password.My blog - https://www.HannesHolst.com/5 -
Could this be a double hop issue? The fact that is cannot authenticate the second call to the Web Service with the credentials you pass in the first call?5
-
Does the account which is used to run the NAV web service have a windows login with sufficient rights in the NAV database?5
-
When calling the first webservice there was no problem with AD user.
Tried to set default user when calling the next webservice and tried without setting any user (thinking that it will use the user already log in).
But now I'm setting the user credentials for the user to the webservice and then I get this error instead:
0 -
Mismatch in our wsdl from test enviorment to customers enviorment was the cause of error with "The target principal name is incorrect".
Everything seems to work fine by now.
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
- 323 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
