The request failed with HTTP status 401: Unauthorized?

Discussion in 'ASP .Net Web Services' started by Asaf, Sep 18, 2007.

  1. Asaf

    Asaf Guest

    Hi,

    I have two web services.

    The Main WS is installed on my Windows 2003 server and when connecting to it
    there is a must to provide User & Pass for the "Integrated Windows
    Authentication" by the IIS.

    I have a Secondary WS that will connect to the Main WS so I transfer User &
    Pass by setting
    ICredentials credentials = new NetworkCredential("MyUser", "MyPass"); to it.

    The problem is that when I connect to the Main WS from my machine with the
    Secondary WS, it works well, but when trying to connect to Main WS with the
    Secondary WS from within Windows 2003 machine locally I am receiving the
    error:

    "Server was unable to process request. ---> The request failed with HTTP
    status 401:
    Unauthorized"

    Thanks in advanced for any help,
    Asaf
     
    Asaf, Sep 18, 2007
    #1
    1. Advertising

  2. Hi Asaf,

    I think this is because the second WS is running in the default application
    pool of IIS that doesn't have network access. This is not related to the
    credential you're using to access the first WS; it's actually occurred
    before that point.

    To fix this, you will need to create a separate Application Pool on your
    second IIS server and use a domain account to run that application pool (on
    the Identity tab), this will make sure code running in this application
    pool can access network. Then configure your second WS to use this new
    application pool.

    Let me know if you have anything unclear. Thanks.


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Sep 18, 2007
    #2
    1. Advertising

  3. Asaf

    Asaf Guest

    Hi Walter,

    Each one of these two web services has its own separate application pool.

    Kind Regards,
    Asaf


    ""Walter Wang [MSFT]"" wrote:

    > Hi Asaf,
    >
    > I think this is because the second WS is running in the default application
    > pool of IIS that doesn't have network access. This is not related to the
    > credential you're using to access the first WS; it's actually occurred
    > before that point.
    >
    > To fix this, you will need to create a separate Application Pool on your
    > second IIS server and use a domain account to run that application pool (on
    > the Identity tab), this will make sure code running in this application
    > pool can access network. Then configure your second WS to use this new
    > application pool.
    >
    > Let me know if you have anything unclear. Thanks.
    >
    >
    > Regards,
    > Walter Wang (, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
     
    Asaf, Sep 18, 2007
    #3
  4. Hi Asaf,

    Then what's the identity configured to run each application pool? Does the
    identity of the one that your second WS runs in have network access
    privilege to reach the first WS?

    If you have configured an identity for the application pool that should
    have access to the first WS, would you please post some of your code here?
    I think we may miss some information here to fully understand the issue.
    Thanks.


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Sep 19, 2007
    #4
  5. Hi Asaf,

    Please refer to following KB:

    #Troubleshooting HTTP 401 errors in IIS
    http://support.microsoft.com/kb/907273


    Two possible issues of the 401 error that're related to webservice are:

    #You receive error 401.1 when you browse a Web site that uses Integrated
    Authentication and is hosted on IIS 5.1 or IIS 6
    http://support.microsoft.com/kb/896861/

    This one is possible if you're using fully qualified domain name.

    #You receive an "HTTP Error 401.1 - Unauthorized: Access is denied due to
    invalid credentials" error message when you try to access a Web site that
    is part of an IIS 6.0 application pool
    http://support.microsoft.com/kb/871179/

    This one is possible if you're using a domain account for your application
    pool.

    Hope this helps.


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Sep 19, 2007
    #5
  6. Asaf

    Asaf Guest

    Hi Walter,

    This solution solved my problem:

    http://aspadvice.com/blogs/ssmith/archive/2007/02/09/SQL-Reporting-Services-401-Error.aspx

    Thanks for your support,

    Asaf


    ""Walter Wang [MSFT]"" wrote:

    > Hi Asaf,
    >
    > Please refer to following KB:
    >
    > #Troubleshooting HTTP 401 errors in IIS
    > http://support.microsoft.com/kb/907273
    >
    >
    > Two possible issues of the 401 error that're related to webservice are:
    >
    > #You receive error 401.1 when you browse a Web site that uses Integrated
    > Authentication and is hosted on IIS 5.1 or IIS 6
    > http://support.microsoft.com/kb/896861/
    >
    > This one is possible if you're using fully qualified domain name.
    >
    > #You receive an "HTTP Error 401.1 - Unauthorized: Access is denied due to
    > invalid credentials" error message when you try to access a Web site that
    > is part of an IIS 6.0 application pool
    > http://support.microsoft.com/kb/871179/
    >
    > This one is possible if you're using a domain account for your application
    > pool.
    >
    > Hope this helps.
    >
    >
    > Regards,
    > Walter Wang (, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
     
    Asaf, Sep 20, 2007
    #6
    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. Sachin
    Replies:
    2
    Views:
    18,002
    Sachin
    Nov 4, 2005
  2. ad
    Replies:
    2
    Views:
    13,585
  3. ad
    Replies:
    0
    Views:
    1,642
  4. Kevin Burton

    The request failed with HTTP status 401: Unauthorized.

    Kevin Burton, Dec 17, 2004, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    169
    Mohamed El Ashmawy
    Dec 19, 2004
  5. Sachin

    The request failed with HTTP status 401: Unauthorized

    Sachin, Nov 4, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    150
    Sachin
    Nov 4, 2005
Loading...

Share This Page