Professional Web Applications Themes

Web Service + Anon Access, but getting 401 Access Denied Error - ASP.NET Web Services

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 ...

  1. #1

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

    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 ([url]http://www.dotnet247.com/[/url])

    <Id>Nz74j70aE0SfGiHcLfpbqw==</Id>
    Alex Washtell via .NET 247 Guest

  2. #2

    Default Re: Web Service + Anon Access, but getting 401 Access Denied Error

    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" <anonymousdotnet247.com> wrote in message
    news:uzufcOfOFHA.508TK2MSFTNGP12.phx.gbl...
    >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 ([url]http://www.dotnet247.com/[/url])
    >
    > <Id>Nz74j70aE0SfGiHcLfpbqw==</Id>

    Mauro Ottaviani [MSFT] Guest

Similar Threads

  1. Access Denied - Network Service vs Local Service
    By mangia in forum ASP.NET Security
    Replies: 3
    Last Post: September 27th, 09:26 PM
  2. DPAPI Service Start access is denied
    By Martin in forum ASP.NET Security
    Replies: 6
    Last Post: September 10th, 07:53 AM
  3. Web Service Access Denied with MS Word
    By Selden McCabe in forum ASP.NET Web Services
    Replies: 1
    Last Post: August 3rd, 05:06 PM
  4. XML Web Service Client Deployment Failu401 Access Denied
    By Matt in forum ASP.NET Web Services
    Replies: 1
    Last Post: January 3rd, 01:40 PM
  5. Web Service Credentials - Access Denied
    By Stan in forum ASP.NET
    Replies: 1
    Last Post: December 8th, 11:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139