Timeout issue on CF app that calls a web service multiple times

  • Thread starter Thread starter Patrick Seymour
  • Start date Start date
P

Patrick Seymour

I have a C# app that allows our technicians to retrieve their tickets and
work orders (long-term tickets) from our help desk software's database. The
web service works just fine when called from a desktop application, even if
repeated calls are made to the service in rapid sequence.

However, on the Pocket PC (2002 or 2003), I can only call the web service
once in a while. If I make two calls to the service in a short time period,
the first call completes successfully and the second call times out.

Here is the code that gets called when the user chooses the Get Tickets
option....



System.Threading.ThreadStart getTicketsDelegate = new
System.Threading.ThreadStart (this.GetTicketsFromServer);
System.Threading.Thread openTickets = new System.Threading.Thread
(getTicketsDelegate);
openTickets.Start ();

// This is the method called in the thread....
private void GetTicketsFromServer ()
{
try
{
TicketServiceWrapper service = new TicketServiceWrapper();
service.RetrieveTickets();
}
catch (System.Net.WebException webExcep)
{
MessageBox.Show ("Unable to retrieve ticket information.\n\nError
message: " + webExcep.Message, "Error Retrieving Tickets",
MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
}
catch (System.Exception genericException)
{
MessageBox.Show ("Unable to retrieve ticket information.\n\nError
message: " + genericException, "Error Retrieving Tickets",
MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
}
finally
{
OpenLocalTicketsFile(); // this just reads the contents of a
local (downloaded) file
}
}



From TicketServiceWrapper (service object is properly initialized
elsewhere)....


public void RetrieveTickets ()
{
try
{
bool serviceIsAvailable = Net.IsURLAvailable (service.Url);
XmlNode openTickets = service.GetOpenTickets (loginID, password,
"LIST_OF_USERS_FOR_WHICH_TICKETS_ARE_RETRIEVED");
System.IO.StreamWriter writer = new System.IO.StreamWriter
(settings.LocalTicketFilePath);
writer.WriteLine (openTickets.OuterXml);
writer.Close();
}
catch (System.Net.WebException webExcep)
{
throw (webExcep);
}
}




Any help would be greatly appreciated. I can post more code if needed; I
was just trying to keep it to a minimum.



Patrick
 
I've experienced exacty the same problem I believe its a compact framework
bug, hopefully microsoft will bet it fixed. It only occurs on certain Server
setups, which I do not know yet.

If you change your call from compact framework to a desktop application I
bet it works faultlessly all the time???
 
Neville Richardson said:
I've experienced exacty the same problem I believe its a compact framework
bug, hopefully microsoft will bet it fixed. It only occurs on certain Server
setups, which I do not know yet.

If you change your call from compact framework to a desktop application I
bet it works faultlessly all the time???

Yes, it works perfectly. I created a test desktop application to randomly
select a technician's name and retrieve that person's tickets. I had it
repeat this process non-stop for several hours, and the application and the
web service never died. Try it just twice on the CF version, and it times
out the 2nd time.


--ps
 
Back
Top