private void Page_Loaded(object sender, RoutedEventArgs e) { // Make sure the dyanmic URL is set (for testing). EndpointAddress address = new EndpointAddress("http://localhost:" + HtmlPage.Document.DocumentUri.Port + "/SilverlightUploader.Web/FileService.svc"); client.Endpoint.Address = address; // Attach these event handlers for uploads and downloads. client.DownloadFileCompleted += client_DownloadFileCompleted; client.UploadFileCompleted += client_UploadFileCompleted; // Get the initial file list. client.GetFileListCompleted += client_GetFileListCompleted; client.GetFileListAsync(); }