473,326 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Web Service timeout crashes clilent

I have a C++ client application that uses a Web Service. It sets up
CookieContainer so that each call is in the same session. Once the web
service is logged on it appears to time out after a couple of minutes
and an NullException is thrown in the application. Is there any way to
trap this error. The proxy uses SoapHttpClientProtocol and I have
tried setting the Disposed event but this does not help.

I would appreaciate any help that can be given on this.
Steve Marriott
Nov 21 '05 #1
5 6490
try...catch ?

<St***@smarriott.demon.co.uk> wrote in message
news:5b**************************@posting.google.c om...
I have a C++ client application that uses a Web Service. It sets up
CookieContainer so that each call is in the same session. Once the web
service is logged on it appears to time out after a couple of minutes
and an NullException is thrown in the application. Is there any way to
trap this error. The proxy uses SoapHttpClientProtocol and I have
tried setting the Disposed event but this does not help.

I would appreaciate any help that can be given on this.
Steve Marriott

Nov 21 '05 #2
Thanks Dino,

try ... catch is a good way of catching exceptions. The problem is
where in the code to put it. At the time of the timeout/exception I am
not actually calling the Web Service.

Sequence of events.
Create the proxy class,
Set the CookieContainer = new CookieContainer, to enable
persistance of session.
call the logon method on the service, display the result on a form.
wait couple of minutes, doing nothing.
Exception notification arrives. Gives code address as 000000.

Hope this helps,

Steve Marriott.

"Dino Chiesa [Microsoft]" <di****@online.microsoft.com> wrote in message news:<es**************@TK2MSFTNGP11.phx.gbl>...
try...catch ?

Nov 21 '05 #3
Hey Steve, what does the stack trace say?
What code is the source of the exception?
You should be able to get this if you run the app within VS.

-D

<St***@smarriott.demon.co.uk> wrote in message
news:5b*************************@posting.google.co m...
Thanks Dino,

try ... catch is a good way of catching exceptions. The problem is
where in the code to put it. At the time of the timeout/exception I am
not actually calling the Web Service.

Sequence of events.
Create the proxy class,
Set the CookieContainer = new CookieContainer, to enable
persistance of session.
call the logon method on the service, display the result on a form.
wait couple of minutes, doing nothing.
Exception notification arrives. Gives code address as 000000.

Hope this helps,

Steve Marriott.

"Dino Chiesa [Microsoft]" <di****@online.microsoft.com> wrote in message
news:<es**************@TK2MSFTNGP11.phx.gbl>...
try...catch ?

Nov 21 '05 #4
Hi Dino,

I am running this in Visual Studio.

To recap I have a form which lets me logon to the service using a
method called logon. I am using CookieContainer to retain session
state. After logging on I have other requests to get data from the
service, however, if I just do nothing and wait after a couple of
minutes I get a System.NullReferenceException in system.dll. It gives
me the chance to break, which I do. It tells me there is no code
available for the current location and it just shows ??? as I am at
location 000000.

The call stack shows
system.dll!System.Net.Sockets.OverlappedAsyncResul t.CompletionPortCallback(uint
errorCode = 64, uint numBytes = 0, System.Threading.NativeOverlapped*
nativeOverlapped = 1883152) + 0xa0 bytes

Any ideas greatly received.

Steve Marriott
Nov 21 '05 #5
This has been solved by overriding the GetWebRequest function and
setting the KeepAlive flag to false.
See:

http://addressof.com/blog/archive/2004/04/26/637.aspx
Cheers for all the help,
Steve Marriott.

Nov 21 '05 #6

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

Similar topics

11
by: Frank Rizzo | last post by:
Hello, My c# based windows service takes a while to dispose. I have to release bunch of resources all over the place and unfortunately it can take 20-40 seconds before I can cleanly exit. ...
0
by: Seth | last post by:
For some reason my service works fine except that it will create the file in my c drive, but will not write to the file. Sorry if this is a duplicate post, i have found some that ask the same...
3
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. ...
0
by: Barb | last post by:
Hello, I have a (C#) web service being consumed by a high volume "asp classic" site. It worked perfectly until I tried consuming a second web service from the first web service. Both services...
1
by: Shane | last post by:
I have a particular requirement when I call a web service; I have to call the web service, wait until the web service returns or my timeout expires (whichever is sooner) and exit. I tried to use...
3
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
0
by: =?Utf-8?B?QWRyaWFuIENvbGU=?= | last post by:
I have written a simple WCF service hosted in a Windows console application and a simple WCF client console application that connects successfully to that service and retrieves data. I then ported...
22
by: Nick Craig-Wood | last post by:
Did anyone write a contextmanager implementing a timeout for python2.5? I'd love to be able to write something like with timeout(5.0) as exceeded: some_long_running_stuff() if exceeded:...
10
by: tshad | last post by:
I have a Windows Service that I need to put to sleep for about 10-20 minutes. The problem is that if you try to shut it down during this time, it will tell you that the service didn't respond in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.