NAV 2009 Web Service not working if not on the domain
jwilder
Member Posts: 263
I have a little vb.net program that uses NAV 2009 web services to return the item description (trying to keep it simple). The 2 lines of code related to authentication are seen here:
MyService.UseDefaultCredentials = False
MyService.Credentials = New System.Net.NetworkCredential(UserID.Text, Password.Text, Domain.Text)
As soon as I try to run this program from a computer that is not on the same domain as the web service machine I get a HTTP 401 error. Even though I pass in the domain it does not work. How can I use web services from a machine that is not on the domain?
MyService.UseDefaultCredentials = False
MyService.Credentials = New System.Net.NetworkCredential(UserID.Text, Password.Text, Domain.Text)
As soon as I try to run this program from a computer that is not on the same domain as the web service machine I get a HTTP 401 error. Even though I pass in the domain it does not work. How can I use web services from a machine that is not on the domain?
Jason Wilder
jwilder@stonewallkitchen.com
jwilder@stonewallkitchen.com
0
Comments
-
Can you share a couple of codelines more + a note about which line causes the exception?Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Here's the vb.net code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyService As New NAVWebservice.ItemCodeunit
Dim outputstring As String
MyService.UseDefaultCredentials = False
MyService.Credentials = New System.Net.NetworkCredential(UserID.Text, Password.Text, Domain.Text)
MyService.Url = "http://swk-lab2:7047/DynamicsNAV/WS/SWKTestU5/Codeunit/ItemCodeunit"
outputstring = MyService.ReturnDescription(TextBox1.Text)
MsgBox(outputstring)
End Sub
The line in bold is where there is an error during runtime. TextBox1 is an Item No. The NAV Codeunit being called literally is just 2 lines of code that return the item description.
Also if I attempt to access the webservice service list (http://swk-lab2:7047/DynamicsNAV/WS/Services) through Internet Explorer it doesn't work either. No error just a blank screen.Jason Wilder
jwilder@stonewallkitchen.com0 -
It turns out we are able to connect with a computer not on the domain as long as it is an xp machine. For some reason Windows 2000 won't let us connect. Since we won't be using Windows 2000 machines this is a not an issue anymore.Jason Wilder
jwilder@stonewallkitchen.com0
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
- 328 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