[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

'Access Denied' when webservice called from WinForm client; no problem when called via IE6

Bill Davidson

1/15/2003 6:04:00 PM

All:

I'm getting an 'HTTP: 401 Access Denied error' when I call a web service
method (the method does nothing but return a boolean 'true') from a WinForm
client; but not when I invoke the method from IE6. The client and the web
service are running on the same computer. The Web Service is set up to run
under "Integrated Windows Authentication" only.

Any ideas why I'm getting the error out of a WinForm client app, but not
from IE?

Thanks,
Bill


2 Answers

omar awwad

1/15/2003 10:51:00 PM

0

you must supply you credential using networkcrdential when
u calling a web service from a webservice client.
>-----Original Message-----
>All:
>
>I'm getting an 'HTTP: 401 Access Denied error' when I
call a web service
>method (the method does nothing but return a
boolean 'true') from a WinForm
>client; but not when I invoke the method from IE6. The
client and the web
>service are running on the same computer. The Web
Service is set up to run
>under "Integrated Windows Authentication" only.
>
>Any ideas why I'm getting the error out of a WinForm
client app, but not
>from IE?
>
>Thanks,
>Bill
>
>
>.
>

Bill Davidson

1/15/2003 11:12:00 PM

0

Thanks, Omar. I just found that out as well. For the benefit of others,
here is the reference ...


"If you are using Windows authentication, you must specify the credentials
to be used for authentication using the 'Credentials' property of the Web
service proxy. I you do not explicitly set this property, the Web service
is called without any credentials. If Windows authentication is required,
this will result in an HTTP status 401 ("Access Denied") response."


For example:

oMyWebSvc = new WebReferences.MyWebSvc.ComponentA();
oMyWebSvc.Credentials = System.Net.CredentialCache.DefaultCredentials;
// add this line
...
...
x = oMyWebSvc.SomeMethod();




"omar awwad" <oawwad@ccc.gr> wrote in message
news:65e601c2bce0$3d76b080$8af82ecf@TK2MSFTNGXA03...
> you must supply you credential using networkcrdential when
> u calling a web service from a webservice client.
> >-----Original Message-----
> >All:
> >
> >I'm getting an 'HTTP: 401 Access Denied error' when I
> call a web service
> >method (the method does nothing but return a
> boolean 'true') from a WinForm
> >client; but not when I invoke the method from IE6. The
> client and the web
> >service are running on the same computer. The Web
> Service is set up to run
> >under "Integrated Windows Authentication" only.
> >
> >Any ideas why I'm getting the error out of a WinForm
> client app, but not
> >from IE?
> >
> >Thanks,
> >Bill
> >
> >
> >.
> >