Solved

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

Posted on 2004-04-02
4
182 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
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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

939 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

10 Experts available now in Live!

Get 1:1 Help Now