Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
send messages to whatsapp programatically 2 48
What is "public object" in C#? 3 47
Hey!! 5 33
Getting error in connectionstring with Excel. 30 32
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

773 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