Re: Web Service 401 Authorization Err
- From: "Neil Moss" <neil.moss@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 16 Jan 2007 09:16:49 -0000
Hi Rick
This sounds to me like a credentials-propagation problem. When your asp.net
app tries to access the web service, it only has a credentials token from
the original caller, which is not valid across another network hop. This
would explain why the app works when on the local machine, and when there is
no database involved.
To _test_ whether this is the case, replace the Windows authentication on
your IIS asp.net app with Basic authentication. I know this is not secure,
but the difference is that the full username and password are sent to the
asp.net server, which can use them itself when talking to the web service.
If this works, credentials propagation is the problem. There is a server
setting (within Active Directory, I think) that allows a server to propagate
credentials. MSDN describes the setting as "trusted for delegation and
protocol transition". See
http://msdn2.microsoft.com/en-us/library/ms998351.aspx - of course, it
varies depending on whether you are using Windows Server 2000 or 2003.
If not, sorry - I'm lost as well.
Good luck
Neil.
"Rick Vooys" <RickVooys@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F8C90D32-2F04-41E1-A350-4FA1F0BF0325@xxxxxxxxxxxxxxxx
We are creating a web service which contain all the buisness logic for our
application. The web service will be consumed by both a ASP.net Web
Application and a Windows Form Application.
We are new to the .Net platform, so please don't be afraid to explain
simple
concepts in great detail, everything is new to me. And if I am on the
wrong
road, give me directions.
We have created the webs service and it works for the Windows form
application. As well it run when you use the local machine as a server.
But
when it is run with the ASP.net app connecting to the server it crashes.
As
well, a webmethod was created to return a simple string an it worked, only
when the dataset is returned does it crash.
We are using windows authentication, with impersonation, the code is as
follows:
ws = new RobcoWebService.RobcoWebService()
ws.PreAuthenticate = true;
ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
(As we we have tried sending specific Admin accounts through, and we
tested
what user was being passed and the current user was being used inside the
web
service)
The request failed with HTTP status 401: Unauthorized.
Any ideas? We had to scrap this for a moment and use a .DLL just so we
could
get the demo ready but we want to move back to the web service.
.
- Follow-Ups:
- Re: Web Service 401 Authorization Err
- From: Rick Vooys
- Re: Web Service 401 Authorization Err
- Prev by Date: Webservice connection is not properly closed
- Next by Date: Type Conversion Error at Compile-Time.
- Previous by thread: Webservice connection is not properly closed
- Next by thread: Re: Web Service 401 Authorization Err
- Index(es):
Relevant Pages
|