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?
0
Comments
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.
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.
jwilder@stonewallkitchen.com
jwilder@stonewallkitchen.com