Web Service + Anon Access, but getting 401 Access Denied Error

Discussion in 'ASP .Net Web Services' started by Alex Washtell via .NET 247, Apr 5, 2005.

  1. I have a simple webservice that just returns a string. The security for this is set to windows authentication in IIS (XP Professional) and anonymous access is also turned on.

    When I access the webservice from IE there is no problem, it returns the string fine. However, when I create a simple console application to use this service and output the string, I get a 401 Access Denied error.

    I have tried the method of setting the default credentials, but this isn't suitable (I can explain why but is not relevant), and the key issue here is that anonymos access IS enabled, so I shouldn't have to set the credentials anyway, surely?

    This was working fine until I came back to it after a couple of weeks, and I am unsure what I could have changed in my settings in Windows. As far as I can see this appears to be an IIS problem, rather than an application one.

    Any help is greatly appreciated, thanks,

    Alex

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>Nz74j70aE0SfGiHcLfpbqw==</Id>
    Alex Washtell via .NET 247, Apr 5, 2005
    #1
    1. Advertising

  2. The 401 you're getting is probably due to the fact that the anonymous user
    does not have access to the resource. Check the file ACLs and make sure that
    IUSR_%computername% has access to it.

    IE is probably performing the authentication using default credentials in
    this case (you can check the IIS logs to verify that it starts by sending a
    401).

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Alex Washtell via .NET 247" <> wrote in message
    news:...
    >I have a simple webservice that just returns a string. The security for
    >this is set to windows authentication in IIS (XP Professional) and
    >anonymous access is also turned on.
    >
    > When I access the webservice from IE there is no problem, it returns the
    > string fine. However, when I create a simple console application to use
    > this service and output the string, I get a 401 Access Denied error.
    >
    > I have tried the method of setting the default credentials, but this isn't
    > suitable (I can explain why but is not relevant), and the key issue here
    > is that anonymos access IS enabled, so I shouldn't have to set the
    > credentials anyway, surely?
    >
    > This was working fine until I came back to it after a couple of weeks, and
    > I am unsure what I could have changed in my settings in Windows. As far as
    > I can see this appears to be an IIS problem, rather than an application
    > one.
    >
    > Any help is greatly appreciated, thanks,
    >
    > Alex
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>Nz74j70aE0SfGiHcLfpbqw==</Id>
    Mauro Ottaviani [MSFT], Apr 5, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    674
    Jan Tielens
    Jan 3, 2004
  2. Daniel Bass
    Replies:
    5
    Views:
    5,461
    shijobaby
    Feb 6, 2010
  3. Daniel Bass
    Replies:
    3
    Views:
    132
  4. Web Service HTTP 401: Access Denied Problems

    , Sep 23, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    163
  5. David Palau

    Web Service HTTP 401: Access Denied Problems

    David Palau, Sep 23, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    152
    David Palau
    Oct 11, 2005
Loading...

Share This Page