Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems Creating a file
Message
De
13/01/2011 13:24:14
 
 
À
13/01/2011 13:07:38
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01496043
Message ID:
01496059
Vues:
46
>>>>>I've verified the URL is correct by displaying it on the form and copying it to a new web page and running it. I did get asked to login by the Report Server, maybe that's the forbidden part?
>>>>
>>>>Most likely. Perhaps the System.Net.CredentialCache.DefaultCredentials on the clients machine would not have been a valid login?
>>>
>>>Hmm, should i change it to DefaultNetworkCredentials? Or do I do this differently?
>>
>>I guess I'd look at the properties of the credentials used on your development machine and, since that is working, create and use the same credentials on the clients server. Of course I could be wrong - just saying what I'd try......
>
>I think I need to understand the code a bit more.
>
>Have I understood what these lines of code actually do?
>
>
// Create a HttpWeb Request object referring to the desired URL
>System.Net.HttpWebRequest Req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(URL);
>// Set the security credentials to be used by the httpwebrequest
>Req.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
>// Specify that we will call the Get method
>Req.Method = "GET";
>// Actually "run" the URL and get the response back.
>System.Net.WebResponse objResponse = Req.GetResponse();
>
AFAIK, Yes.

>If I comment out the credentials then I get a (401) Unauthorized error on my PC. Which is different to the 403 error I'm getting at the client.

401 is 'Unauthorised' so either no credentials were sent or, if they were, they were invalid.
403 is 'Forbidden' . But I don't know why you'd get in this case.

>How do I look at the properties of the credentials on my machine?
Debugger :-} But if your getting a 401 then presumably they aren't going to work anyway ?

>Thanks for all your help.
Best hold off on that until you actually solve the problem :-}
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform