Error : the request failed with HTTP status 401: Access Denied

Topics: General Discussion Forum, July and December Releases Forum
Feb 19, 2008 at 2:01 PM
Hi,

If anybody have come accross this type of error,
please let me know how did u manage to over come this error.

I have hosted a service in the IIS, where i can browse it from the IIS,
there i am getting

svcutil.exe http://xxxxxxxxx/NewService/HelloWorldService.svc?wsdl

i run this in cmd prompt. it generates two files namely..... helloWorldService.cs and output.config...
I pasted the content of output.config in web applications web.config file...(The application from where i have to call this service.)


and i added a web reference for the application, where i had given the URL http://xxxxxxxxx/NewService/HelloWorldService.svc?wsdl
i could add the reference, so inside the App_WebReferences Folder i am having 4 files.

In the default.aspx page i wrote following codes:
webservice.HelloWorldService client = new webservice.HelloWorldService();
client.HelloOperation("Hello");
Then i am recevign this error.....

The request failed with HTTP status 401: Access Denied.

Does anybody have any suggession for this error....
Please help me up....

Nimesh



Developer
Feb 19, 2008 at 2:47 PM
This is an IIS config problem. There are many sites out there with this kind of topics, this is one of them http://geekswithblogs.net/ranganh/archive/2006/02/21/70212.aspx.
BTW, I don't know why you use svcutil AND also add a reference to your service (Using VS option menu?).
You may use one of them, (in your case the svcutil should be fine) so you won't end up with those files in App_WebReferences folder.
Feb 20, 2008 at 6:03 AM
Edited Feb 20, 2008 at 6:17 AM
I had gone through the link which you have sent, but is of no use. Even after doing all the steps mentioned there, i am geting the same error.
Now i am using only the svcutil.exe to create proxy classes,
but i am not able to call that class after addign it into the solution explorer>app_data.
How can it be Possible ?
Please help me regarding this issue.
Developer
Feb 20, 2008 at 11:14 AM
Try adding the generated file in your host web app under App_Code folder (create one if it doesn't exists).
Note: Please try posting all your questions regarding this topic "How to call a service from a web client" in one thread so it will be easy to track down the history of the Q&A and it will be also easy to find everything in one place :-)

Thanks,
CF