>When I call a webservice and it returns an error how can I trap the full error message
>
>I've got this code
>
>HttpWebResponse response = null;
> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(profileAPIURL);
> request.Headers.Add("Authorization", oAuth);
> try
> {
> response = (HttpWebResponse)request.GetResponse();
> }
> catch (Exception ex)
> {
> Console.WriteLine("Exception Occured:" + ex.Message);
> }
>
>but the catch just gives me a server error like "The remote server returned an error: (400) Bad Request." and I want to know the reason its a bad request.
>
>Thanks
>
>Nick
Did you check everything for ex, also ex.InnerException?
If it's not broken, fix it until it is.
My Blog