So far, I have been able to capture and export all email messages from GroupWise using the SOAP API and Events. I have the application set up as a trusted application through C1 with the "Provides Message Retention Service" option checked. Now, I'm trying to mark the messages as retained through the SOAP API after I'm done processing the messages. I'm setting the "retentionModified" property of the "Mail" class to the current date/time and I'm setting the "retentionModifiedSpecified" property to true. I know the modifyItemRequest is successful because if I change the subject, GroupWise shows the new subject. The problem I'm having is even after I specify the retentionModified value, I am still unable to purge the mail item from the trash can. Is this the expected behavior? Am I missing something? Below is the code I'm using to set the retention value.

Private Sub MarkRetained(userId As String, messageId As String)

Dim mailItem As New Mail
mailItem.retentionModified = Date.Now
mailItem.retentionModifiedSpecified = True

Dim request As New modifyItemRequest = messageId
request.updates = New ItemChanges
request.updates.update = mailItem

Dim binding As GroupWiseBinding = GWSessionManager.GetSession(userId).GroupWiseBindi ng

Dim response As modifyItemResponse = binding.modifyItemRequest(request)

If response.status.code <> 0 Then
MsgBox(String.Format("{0} [{1}]", response.status.description, response.status.code))
End If

End Sub