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
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