NAV 2009 Web Service not working if not on the domain

jwilderjwilder Member Posts: 263
edited 2009-03-31 in NAV Three Tier
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?

Comments

  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    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.
  • jwilderjwilder Member Posts: 263
    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.
  • jwilderjwilder Member Posts: 263
    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.
Sign In or Register to comment.