The sample for this chapter continues from where we left off in Chapter 32, “Conducting Background Activities with Scheduled Actions.” This chapter looks at backing up the to-do items database to a remote server using WCF.
Within the BackgroundAgents solution in the downloadable sample code is a project named WPUnleashed.BackgroundAgents.Web. This project exposes a WCF service named BackupService, which allows the phone app to save files to the Backups directory on the server by way of its
SaveFile method (see Listing 33.1). The
SaveFile method accepts a Stream, which is written to a file on the server. The unique ID of the user is also sent to the server to allow correct retrieval of the file at a later ...