0

While developing my WP8 app I got stuck while implementing offline mode. My mobile app is comunicating with server using WCF methods calls through https.

I'm already saving incoming data to my local storage for offline viewing. However my problem is I have no idea how to implement something like a message queue system for method calls.

If I was using JSON as a medium of tranfer, I could just save it in database and send the request when the mobile is online. With method calls I cannot do that.

Is there a way to delay the WCF method call until the client is online in my situation?

Thank you for your time and answers.

Folio
  • 33
  • 4
  • Have you thought about using a message queue library? Consider MSMQ for instance... – Aron Feb 21 '15 at 16:38
  • This seems like it might help http://stackoverflow.com/questions/9971393/how-to-send-queue-message-from-windows-phone – Aron Feb 21 '15 at 16:40
  • I have found MSMQ while searching for possible solutions. However I haven't found a single mention about it working with Windows Phone. Well thank you for your idea. I'll look into it. – Folio Feb 21 '15 at 16:49
  • It looks like I cannot use MSMQ over http. http://stackoverflow.com/questions/19414046/using-msmq-over-http-how-to-address-the-queue – Folio Feb 21 '15 at 16:54
  • You *can* enqueue method calls, by using delegates. But you can't serialize them, and they'll be lost if the user exits your app. So I'm not sure that's what you want... If you want to be able to restore the queue state when relaunching the app, you'll have to manually serialize/deserialize the calls (for instance, writing the name of the method you need to call, then call it using a switch statement when deserializing). Reflection may help making that part dynamic, but don't expect miracles – Kevin Gosse Feb 21 '15 at 17:20
  • I could move this logic to the background worker. Thank you, I'll try. – Folio Feb 21 '15 at 17:27

0 Answers0