What is message intended to be? Is it the message that was sent, or an error message? If sharepoint.UploadedCompleted returns EventArgs, you can access these within your callback function. For example I have the following code for loading an email template within a service:
Public Function LoadEmailTemplate(ByVal template As String) Dim path As String = AppDomain.CurrentDomain.BaseDirectory + "EmailTemplates\" + template Return (File.ReadAllText(path)) End Function
Then within my client app, I just do:
Private Sub loadEmailTemplate_completed(ByVal sender As Object, ByVal e As MainServiceReference.LoadEmailTemplateCompletedEventArgs) Dim body As String = e.Result body = body.Replace("{CHEMICAL}", chemApp.Chemical.tradeName) body = body.Replace("{REQUESTEDBY}", chemApp.requestedBy) body = body.Replace("{FACILITY}", chemApp.facilityPath) body = body.Replace("{ID}", chemApp.ID) clientMain.SendMailAsync(toAddress, fromAddress, subject, body) End Sub
I can then access the return value via the LoadEmailTemplateCompletedEventArgs. Can you do something similar with sharepoint.uploadcompleted? i.e configure it to return a value, then access it via EventArgs?
Oh, for reference, the event handler is just:
AddHandler clientMain.LoadEmailTemplateCompleted, AddressOf loadEmailTemplate_completed