The request failed with HTTP status 401: Unauthorized?


A

Asaf

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
 
Ad

Advertisements

W

Walter Wang [MSFT]

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 ([email protected], 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.
 
A

Asaf

Hi Walter,

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

Kind Regards,
Asaf
 
W

Walter Wang [MSFT]

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 ([email protected], 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.
 
W

Walter Wang [MSFT]

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 ([email protected], 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.
 
Ad

Advertisements

Ad

Advertisements


Top