Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > The request failed with HTTP status 401: Unauthorized?

Reply
Thread Tools

The request failed with HTTP status 401: Unauthorized?

 
 
Asaf
Guest
Posts: n/a
 
      09-18-2007
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

 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      09-18-2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
 
 
 
Asaf
Guest
Posts: n/a
 
      09-18-2007
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 ((E-Mail Removed), 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.
>
>

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      09-19-2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      09-19-2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
Asaf
Guest
Posts: n/a
 
      09-20-2007
Hi Walter,

This solution solved my problem:

http://aspadvice.com/blogs/ssmith/ar...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 ((E-Mail Removed), 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.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with ReportingService.Credentials - Syste.Net.WebException - "The request failed with HTTP status 401: Unauthorized." Shree ASP .Net 0 09-02-2006 07:33 PM
The request failed with HTTP status 401: Unauthorized ad ASP .Net 2 02-18-2006 12:11 AM
The request failed with HTTP status 401: Unauthorized ad ASP .Net 0 02-17-2006 06:14 AM
The request failed with HTTP status 502: Bad Gateway muradmeghani@gmail.com ASP .Net 1 02-06-2006 10:56 PM
The request failed with HTTP status 401: Unauthorized Sachin ASP .Net 2 11-04-2005 09:15 PM



Advertisments