Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help! Trying to Build Asynchronous XML Web Service Consumed by .NET CF App...

Posted on 2004-04-02
4
Medium Priority
?
189 Views
Last Modified: 2012-08-14
I'm trying to build an asynchronous XML web service that will allow a Pocket PC application to get an image from a remote server.  I don't want the image to be saved to the device or stored in a SQL CE DB because of memory constraints; I only want the image to be displayed in a mobile application as requested by the user, and wiped from memory after either: resetting the device, or after a period of time has elapsed (a la temp files in Internet Explorer).

Does anyone have any recommendations or ideas? Thanks.

PS  We are developing in C#.
0
Comment
Question by:lyptus
4 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 750 total points
ID: 10742608
When you make a proxy class for the web service (using wsdl.exe or VS.NET), asynchronous methods are automatically generated. If you have a method named GetNumber in the web service, the proxy class will have three methods: GetNumber, BeginGetNumber, and EndGetNumber. You'll need to write a callback method that gets called when the web service returns the value. Asynchronous calls are exactly the same in web services as they are in regular apps.

There's an excellent article here:
http://builder.com.com/5100-6373-1044325.html
0
 
LVL 37

Assisted Solution

by:gregoryyoung
gregoryyoung earned 750 total points
ID: 10782622
no problem should be very simple ... should look something like the following ...

I can give you full code for parts 1&2 as the Image object does most of the work ...

a webservice which returns an image object (very easy)
a webservice client which consumes an image object (very easy )

a manager object which encapsulates this ....
sounds like it should be a process level (machine level would be better but most likely unnecesary) singleton (i.e. suppor CreateInstance() or something similar) and have a method for GetImage() ;

You said however that you wanted this to be an async webservice ... that should be fine changing to beginmethod() and endmethod() with a delegate if you are familiar with the pattern, if not I can provide a ton of examples on this. I would most likely check to see if I have the local file before issuing the async method as it will return near instantaneously.

As for possibly deleting it with a timeout it would be a fairly simple matter to lock your storage mechanism (hash, list, etc) and remove items which have become stale ... I would personally suggest something similar to the asp.net caching system if you have the time to implement it, where you monitor free resources on the device to determine how aggressive you are with removing items.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question