Click to See Complete Forum and Search --> : the request failed with HTTP status 401:Access denied.?!


jasie24
October 12th, 2003, 03:36 PM
I made a simple web service,and after that a simple web application and when i have tried to run it(when i push a button "btnGetText",and it should show me in a label a text),it gives me this message:
"The request failed with HTTP status 401:Access denied"

For example,
"TestService" is the class that contains my webMethod:
the location is something like that:
http://localhost/TestService/Category.asmx

and in my web application example was something like that:


imports TestService.localhost
....

private sub btnGetText_click(byval sender as object,e as EventArgs)
dim myProxy as new localhost.Category
lblText.text=myProxy.WriteText("Apple")
end sub

where "WriteText" is the public method from my service
and "localhost" is that proxy class with the default name when i added a Web Reference with my service.
I have to set something in IIS or why can i run my web service on my local server?
Many Thanks

redsolo
October 19th, 2003, 05:11 AM
try this:
http://[your computer name]/TestService/Category.asmx, and you must have admimistrator permission.

localhost refer to IUSR_NET User in your system. if you want anonymous users access your ISS. you should:

right click your IIS's root (if you want all under that access permission ) or just your website ,select Properties.and select Directory Security page tab, in the Anonymous Access ...GroupBox click Edit button ,Check Anonymous Access and Windows Intergrated Authorization.

hope this hlps

jasie24
October 19th, 2003, 03:36 PM
I solve it.
The problem was that in IIS/Directory Security,
at user i had to put IUSR_SERVER,
SERVER is my server name,before it was just SERVER. i put it maybe,accidentally,while trying to solve the issue.But it was always checked Anounymous and Integrated Windows mode,
that's why i didn't pay too much attention to what it was written in the user box.But i still don't get it,if Anonymous was checked,so it should not matter what user and password is,why it has matter eventually,as i saw.because i modified the user ,as i said.strange....!