I have not attempted anything like this with an ashx. I have used asmx files
in the same project (as an experiment, as I see no reason to involve the
HTTP stack for something that is local (If I needed both in the same
project, the ASMX would be used remote and the class files locally).
WIth your project, I assume the ASHX has a purpose for external clients. If
not, I would not keep it as your data access method. Even if so, I would
refactor the actual data access methods to a class rather than leave in the
ASHX and call this class directly for local access of the data. It makes it
easier to unit test, as well.
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
*************************************************
| Think outside the box!
|
*************************************************
"kellygreer1" <(E-Mail Removed)> wrote in message
news:9175e7dc-af27-4782-96b6-(E-Mail Removed)...
>I have a ASP.NET WebSite running on IIS6 on Windows 2003.
> I'd like to have the Default.aspx page be able to web scrape a page
> from the same site "data.ashx".
> I'd like to keep everything NT Authentication.
>
> Nothing I try seems to work. I always get a 401 authorization error.
> Here is what I have tried.
> 1) WebClient
> 2) WebClient + new Credentials
> 3) WebClient + Impersonation in web.config
> 4) Application Pool with Network Identity - and then I get Service
> Unavailable on my site.
>
> Help!
>
> What is the correct way to do this? Either a WebClient call or a Soap
> call to the same server or remote with NT Authentication. I can't
> seem to figure out why I get the 401 error and no idea how to
> troubleshoot or solve.
>
> Thanks,
> Kelly Greer
> (E-Mail Removed)
> change nospam to yahoo