PC Review


Reply
Thread Tools Rate Thread

Caching Web Service Calls when disconnected. (C# Project)

 
 
=?Utf-8?B?UGFuY2hv?=
Guest
Posts: n/a
 
      8th Jun 2005
Hello,

First time poster here. We are developing an application running on the
Pocket PC O/s that connects to a Java application server. We have real
time services working. We are now developing code for a disconnected
state.

On the pocket PC we catch a SoapException, letting us know the system is
unavailable. At this point, I would like to start caching pertinent web
service
calls. My first question is how should these web service calls be stored. As
raw XML? How to save these message so I may call the web service again
asynchronously? During the asynch call, I still need to make sure it
completed.

I am thinking I would start a thread that would wake up and attempt to
reprocess
the first of these cached messages. If unsuccessful, it would go back to
sleep. If successful, it would run thru any saved messages and set back to a
connected or real time mode.

Here is a sample service ....
// DimFreight Service ----------------------------------------------------
public void DimFreight(string mode, string freightlKey, string length,
string width, string height, out string exceptionCode)
{
string nowDate = DateTime.Now.ToString("yyyymmdd");
string nowTime = DateTime.Now.ToString("HHMMss");
exceptionCode = "";
Global global = Global.GetGlobals();

// Call Service
freightService.FreightService service = new freightService.FreightService();
service.Url = FREIGHT_INTERFACE_URL;
try
{
service.DimFreight(mode, global.GetDevice().DeviceID,
global.getEmployee().ID, freightKey, length, width, height, nowDate, nowTime);
}
catch(SoapException soapEx)
{
exceptionCode = soapEx.GetBaseException().Message;
}
catch(Exception ex)
{
exceptionCode = ex.Message;
}
} //End - DimFreight ----------------------------------------------------
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      8th Jun 2005
I implemented a similar solution using the MapPoint web service. Basically
I logged all failed calls to a text file (for persistence) and had a thread
that periodically checked for service availability, when service existed, it
would get data from the MapPoint server (geocode collected GPS data) and
then send it on to my web service. Once that was successful, it removed the
item from the file. The primary consideration is whether you want FIFO
(queue) or LIFO (stack) handling of the messages, but neither is difficult.

-Chris


"Pancho" <(E-Mail Removed)> wrote in message
news:041F6241-6223-44C0-B7E4-(E-Mail Removed)...
> Hello,
>
> First time poster here. We are developing an application running on the
> Pocket PC O/s that connects to a Java application server. We have real
> time services working. We are now developing code for a disconnected
> state.
>
> On the pocket PC we catch a SoapException, letting us know the system is
> unavailable. At this point, I would like to start caching pertinent web
> service
> calls. My first question is how should these web service calls be stored.
> As
> raw XML? How to save these message so I may call the web service again
> asynchronously? During the asynch call, I still need to make sure it
> completed.
>
> I am thinking I would start a thread that would wake up and attempt to
> reprocess
> the first of these cached messages. If unsuccessful, it would go back to
> sleep. If successful, it would run thru any saved messages and set back to
> a
> connected or real time mode.
>
> Here is a sample service ....
> // DimFreight
> ervice ----------------------------------------------------
> public void DimFreight(string mode, string freightlKey, string length,
> string width, string height, out string exceptionCode)
> {
> string nowDate = DateTime.Now.ToString("yyyymmdd");
> string nowTime = DateTime.Now.ToString("HHMMss");
> exceptionCode = "";
> Global global = Global.GetGlobals();
>
> // Call Service
> freightService.FreightService service = new
> freightService.FreightService();
> service.Url = FREIGHT_INTERFACE_URL;
> try
> {
> service.DimFreight(mode, global.GetDevice().DeviceID,
> global.getEmployee().ID, freightKey, length, width, height, nowDate,
> nowTime);
> }
> catch(SoapException soapEx)
> {
> exceptionCode = soapEx.GetBaseException().Message;
> }
> catch(Exception ex)
> {
> exceptionCode = ex.Message;
> }
> } //End - DimFreight ----------------------------------------------------



 
Reply With Quote
 
Sergey Bogdanov
Guest
Posts: n/a
 
      8th Jun 2005
I had the same problem in one of my projects and I had solved it with
Microsoft Offline Application Block. Since at that time there was no
CF.NET version of Offline Block I had to port some parts of it by myself.

At this moment OpenNETCF has the Microsoft Application Block for CF.NET
which is available for download here:
http://www.opennetcf.org/PermaLink.a...9-f1b35813db79

To read more about Offline block see this link:
http://msdn.microsoft.com/library/de...fline-ap01.asp


--
Sergey Bogdanov
http://www.sergeybogdanov.com


Pancho wrote:
> Hello,
>
> First time poster here. We are developing an application running on the
> Pocket PC O/s that connects to a Java application server. We have real
> time services working. We are now developing code for a disconnected
> state.
>
> On the pocket PC we catch a SoapException, letting us know the system is
> unavailable. At this point, I would like to start caching pertinent web
> service
> calls. My first question is how should these web service calls be stored. As
> raw XML? How to save these message so I may call the web service again
> asynchronously? During the asynch call, I still need to make sure it
> completed.
>
> I am thinking I would start a thread that would wake up and attempt to
> reprocess
> the first of these cached messages. If unsuccessful, it would go back to
> sleep. If successful, it would run thru any saved messages and set back to a
> connected or real time mode.
>
> Here is a sample service ....
> // DimFreight Service ----------------------------------------------------
> public void DimFreight(string mode, string freightlKey, string length,
> string width, string height, out string exceptionCode)
> {
> string nowDate = DateTime.Now.ToString("yyyymmdd");
> string nowTime = DateTime.Now.ToString("HHMMss");
> exceptionCode = "";
> Global global = Global.GetGlobals();
>
> // Call Service
> freightService.FreightService service = new freightService.FreightService();
> service.Url = FREIGHT_INTERFACE_URL;
> try
> {
> service.DimFreight(mode, global.GetDevice().DeviceID,
> global.getEmployee().ID, freightKey, length, width, height, nowDate, nowTime);
> }
> catch(SoapException soapEx)
> {
> exceptionCode = soapEx.GetBaseException().Message;
> }
> catch(Exception ex)
> {
> exceptionCode = ex.Message;
> }
> } //End - DimFreight ----------------------------------------------------

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax calls web service in wcf(windows service) Billy Zhang Microsoft ASP .NET 7 31st Jul 2008 08:37 AM
Csharp async calls to Web Service that calls C++ :: blocking issue Brian Parker Microsoft C# .NET 10 21st Apr 2006 03:12 AM
Access ADP Project - (disconnected) =?Utf-8?B?Sm9obiBEZUJvZXI=?= Microsoft Access ADP SQL Server 17 7th Nov 2005 09:02 PM
Printing Report from Disconnected Project with SQL Server Data dougloj Microsoft Access 1 28th Oct 2005 01:22 AM
Access ADP Project - (disconnected) =?Utf-8?B?Sm9obiBEZUJvZXI=?= Microsoft Access External Data 10 4th May 2005 12:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 PM.