Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2006

Tip: Looking for answers? Try searching our database.

The request failed with HTTP status 401: Unauthorized

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
manika02 - 29 Mar 2006 18:06 GMT
Hi,
I get the following eror when I try to call my WebService (on the local
machine) using another Web application (on the local machine)

System.Net.WebException: The request failed with HTTP status 401: Unauthorized

Any insights on this would be helpful.

Thanks
Scott M. - 29 Mar 2006 22:33 GMT
The web service you are attempting to access requires that the caller
provide its credentials to prove that it should be allowed to access the web
service.  You can use this code to send the "default credentials" to the web
service:

Dim myProxy As New localhost.Service1()
myProxy.Credentials = System.Net.CredentialCache.DefaultCredentials

> Hi,
> I get the following eror when I try to call my WebService (on the local
[quoted text clipped - 6 lines]
>
> Thanks
BigJohn - 05 Apr 2006 17:25 GMT
I tried this method and Josh's (set web service with anonymous auth) and
cannot bet either to funtion.  I am running on Windows XP Pro, all modules
are within same solution.

> The web service you are attempting to access requires that the caller
> provide its credentials to prove that it should be allowed to access the web
[quoted text clipped - 14 lines]
> >
> > Thanks
Scott M. - 06 Apr 2006 23:25 GMT
Please show the code you are using to create the web service instance.

>I tried this method and Josh's (set web service with anonymous auth) and
> cannot bet either to funtion.  I am running on Windows XP Pro, all modules
[quoted text clipped - 20 lines]
>> >
>> > Thanks
geyser hi - 10 Apr 2006 18:11 GMT
It works for me (c#). Thanks a lot.

    localhost.Service1 ws=new localhost.Service1();
            ws.Credentials = System.Net.CredentialCache.DefaultCredentials ;
            textBox1.Text=ws.HelloWorld();
geyser hi - 10 Apr 2006 18:11 GMT
Thanks. The code works for me (C#)
   
localhost.Service1 ws=new localhost.Service1();
ws.Credentials = System.Net.CredentialCache.DefaultCredentials ;
       
textBox1.Text=ws.HelloWorld();
Josh Twist - 30 Mar 2006 10:55 GMT
Also, If you're not interested in using Windows Authentication in IIS
to secure your web service you can just turn Anonymous Authentication
on for your web service's Virtual Directory:

- Right click on the virtual directory in IIS
- Choose properties from the context menu
- Select the Directory Security Tab
- Click the Edit button in the Anonymous access and authentication
control
- Check the anonymous access box
BigJohn - 05 Apr 2006 17:19 GMT
I am getting the same problem running on Windows XP Pro with the anonymous
auth.

> Also, If you're not interested in using Windows Authentication in IIS
> to secure your web service you can just turn Anonymous Authentication
[quoted text clipped - 6 lines]
> control
> - Check the anonymous access box

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.