403: Forbidden exception
- From: Giulio Petrucci <fakename@xxxxxxxxxxxxxx>
- Date: Thu, 06 Mar 2008 09:16:26 +0100
Hi there,
I'm traying to consume a web service over an https:// connection (see some threads before ;-) ), and I got it:
System.Net.WebException
The request failed with HTTP status 403: Forbidden.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
....
Is this because I need to authenticate with username and password? Or is because of som certificate-related issue?
In the first case (authentication), should I use the following?
Service proxy = new Service(); //new web service proxy instance;
string username = ConfigurationManager.AppSettings["Username"]; //read username from the config file
string password = ConfigurationManager.AppSettings["Password"]; //read password from the config file
System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(username, password);
proxy.Credentials = credentials;
Thanks in advance,
Giulio - Italia
--
OnAir: Emily Loizeau - "Sur la route"
http://www.giuliopetrucci.it
.
- Prev by Date: Re: SSL certificates
- Next by Date: Re: Deserilazation of Object with collection property Options
- Previous by thread: Re: Itunes error message
- Next by thread: New Information on Error 1603 when installing .NET Framework all versions up to 3.5
- Index(es):
Relevant Pages
|