Solved

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

Posted on 2004-04-02
4
181 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 250 total points
Comment Utility
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 250 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now