472,952 Members | 2,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

Getting more info from WebException when Status is Unknown Error

My app makes a call to a remote server (about which I know relatively
little) using Webclient.DownloadData. This is done once every 51/2 mins
and is called by code within a worker thread. 95% of the time this
works ok and I get a sane response from the server. However, every
night within the same broad time window of 7 hours, I get a relatively
high incidence of WebException's being thrown. The status of this is
"UnknownError". When I try to log the response, i.e. printing out
repsonse.ToString() my error handler throws another exception. I can
only presume this is because response == null. (I am now testing
against response == null). So, where do I start looking for the source
of the error? Under what circumsances will WebClient behave like this?
Will a garbled response from the remote server cause this? I've tried
using a packet sniffer, though the one that I was using HTTPlook
trashed my program and I understand that this is a common problem. Are
there any tried, tested and very reliable packet sniffers out there
that I can use to help me work out what is going on? Anything else I
should look into within my app? There is a limit to how much logging
that can be done on the webserver that I am connecting to; the owners
are doing as much as they can to help.

Is there any significance in the fact that the code that does the
request is on a worker thread? I only mentioned it incase. I'm new to
multithreading and so am not too sure about what sort of things can go
wrong, but one of my coworkers who is well experienced is confident
that it isn't a threading issue.

This has been going on now for about 2 weeks and every nights testing
when I get unhelpful error information is another day lost. So, any
comments / suggestions would be very gratefully received.

Thanks,

Greg.

Feb 17 '06 #1
1 1589
DWS
Possibly server your calling might go offline for backup or hamsters need
feeding.
Good Luck
DWS
"Greg" wrote:
My app makes a call to a remote server (about which I know relatively
little) using Webclient.DownloadData. This is done once every 51/2 mins
and is called by code within a worker thread. 95% of the time this
works ok and I get a sane response from the server. However, every
night within the same broad time window of 7 hours, I get a relatively
high incidence of WebException's being thrown. The status of this is
"UnknownError". When I try to log the response, i.e. printing out
repsonse.ToString() my error handler throws another exception. I can
only presume this is because response == null. (I am now testing
against response == null). So, where do I start looking for the source
of the error? Under what circumsances will WebClient behave like this?
Will a garbled response from the remote server cause this? I've tried
using a packet sniffer, though the one that I was using HTTPlook
trashed my program and I understand that this is a common problem. Are
there any tried, tested and very reliable packet sniffers out there
that I can use to help me work out what is going on? Anything else I
should look into within my app? There is a limit to how much logging
that can be done on the webserver that I am connecting to; the owners
are doing as much as they can to help.

Is there any significance in the fact that the code that does the
request is on a worker thread? I only mentioned it incase. I'm new to
multithreading and so am not too sure about what sort of things can go
wrong, but one of my coworkers who is well experienced is confident
that it isn't a threading issue.

This has been going on now for about 2 weeks and every nights testing
when I get unhelpful error information is another day lost. So, any
comments / suggestions would be very gratefully received.

Thanks,

Greg.

Feb 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sean Erwin | last post by:
I am having a very frustrating intermittent problem. I am making an A2A call to a remote server and when I issue the: WebRequest.getResponse call it occasionally fails with the following error: ...
2
by: Peter Rilling | last post by:
I am trying to use an HttpWebRequest object to get resource from a website. Now, some of the files that I try to get may not exist. I would like to check for that condition. When I call...
2
by: genc_ ymeri at hotmail dot com | last post by:
Hi, I'm trying to recieve the response status code rather than the message in the below code : try { responseArray = myWebClient.UploadValues(uriString,"POST",myNameValueCollection); }...
1
by: etantonio | last post by:
Good morning, I've a problem, in the past I translate my site from google or altavista with a code similar to this : <%@ Page Language="c#" Trace="true" Debug="true" %> <%@ import...
4
by: Sean Feldman | last post by:
Hi, I'm expiriencing something interesting with my web service & desktop client application. When running desktop client on Windows XP or Windows 2003 everything works just fine. But when doinf...
7
by: Terry | last post by:
I have a Mainform with a Statusbar. When opening another form or doing some processing I want to display info in the Statusbar of the Mainform. I have read a lot of articles on this & have come up...
8
by: Tim Reynolds | last post by:
Our .Net application calls a web method of aplpication 2 that resides on their Apache server. When I as a developer C#, Studios 2003, make the call to their web method from my desktop, I receive no...
0
by: Greg | last post by:
My app makes a call to a remote server (about which I know relatively little) using Webclient.UploadData. This is done once every 51/2 mins and is called by code within a worker thread. 95% of the...
9
by: Adem | last post by:
Is it possible to get some info about an unknown exception, ie. the "catch (...)" case below: catch (const blah1 &ex) { cout << "blah1 exception." << endl; } catch (const blah2 &ex) {
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.