[IIS]Unauthorized Access to WebServices from a WebSite

kizinkizin Member Posts: 18
edited 2009-08-25 in NAV Three Tier
Hi,

I develop a webSite which using Nav 2009 WebServices.

When i'm using the web server provided by Visual Studio my web web site works. But When i published this Website on a IIS Server, i got the following error : "The request failed with HTTP status 401: Unauthorized".

The configuration is
- Windows XP fr
- IIS 6.0
- Nav 2009

I use the following code :
        NavWSAchat.WSAchat_Service service = new NavWSAchat.WSAchat_Service();
        service.Url = WS_URL;
        service.UseDefaultCredentials = false;
        //service.Credentials = new System.Net.NetworkCredential("Administrateur", "password", "XP-NAV2009");
        service.Credentials = new System.Net.NetworkCredential("Administrateur", "password");       
Authentification Method for IIS is Anonymous.
Administrateur is the loggued user who gets SUPER rights in Nav2009.

I've tried to put Windows authentification in IIS Authentifcation method and "service.UseDefaultCredentials = false;" but it does not work either.


Thanks,

Yann

Comments

  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    If you leave out this code and just have a simple website - then you don't get any error right? (excludes IIS configuration errors)

    A couple of questions

    Is the IIS Server on a different box than your Service Tier?
    Is SQL Server on a third box?
    Have you tried opening the Web Service URL in a browser from the IIS Server?
    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.
  • kizinkizin Member Posts: 18
    If you leave out this code and just have a simple website - then you don't get any error right? (excludes IIS configuration errors)
    The simple website works correctly
    Is the IIS Server on a different box than your Service Tier?
    if by box, you mean machine, then the answer is yes.
    Is SQL Server on a third box?
    No, it is the standard Nav 2009 set up.
    All is on the same machine.
    Have you tried opening the Web Service URL in a browser from the IIS Server?
    How you can do that?
    - I have opened the web service Url in IE on the Server and it works.

    Thx a lot.
  • eYeeYe Member Posts: 168
    I have found the following with the webpages: adding a gridview to the asp webpage, I did not use the UI to bind the datasource. Instead I used:
        Dim CallListService As New CallList_REF.Call_List_Service
        Dim CallList As New CallList_REF.Call_List
        Dim filters As New List(Of CallList_REF.Call_List_Filter)
        Dim idFilter As New CallList_REF.Call_List_Filter
    
        idFilter.Field = CallList_REF.Call_List_Fields.Call_ID
        idFilter.Criteria = ""
        filters.Add(idFilter)
    
        DataList1.DataSource = CallListService.ReadMultiple(filters.ToArray, Nothing, 100)
    

    Which assigns the datasource, but I have no idea on how to display my datalist?
    Kind Regards,
    Ewald Venter
Sign In or Register to comment.