403: Forbidden exception

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: How do I bind to LDAP with a username/password
    ... authenticating against an LDAP server with a username and password. ... Failure to bind indicates a failure to authenticate. ... You can attempt to bind with some given credentials, ...
    (comp.lang.java.programmer)
  • Re: How do I bind to LDAP with a username/password
    ... authenticating against an LDAP server with a username and password. ... Failure to bind indicates a failure to authenticate. ... You can attempt to bind with some given credentials, ...
    (comp.lang.java.programmer)
  • Re: [SLE] IP Printing issues in KDE
    ... > The problem is that the KDE Daemon would ask me to authenticate in ... > which I did but it keeps rejecting my credentials. ... > username and no luck. ... lppasswd -a ...
    (SuSE)
  • Re: Mapped Drives locking my AD account
    ... A local account and a domain ... Your mapped drive to a domain resource is trying to authenticate ... This time it is passing your LOCAL credentials to the domain. ... In this scenario your local username and password *match* the domain ...
    (microsoft.public.windows.server.active_directory)
  • Re: HTTP 500 Error - Local Security Authority Cannot be contacted
    ... · If you are immediately brought to the error screen (without being ... and those credentials are no longer valid. ... When I was seeing this error with IE, I was able to authenticate ... Disabling IWA from the server allows me to authenticate (i.e. using Basic ...
    (microsoft.public.sharepoint.windowsservices)