Hi,
I'm trying to retrieving a document from a Documentum repository from an externa web app using .net.
I'm using the code snippet below (I've tried it for Base64, MTOM and UCF), but each time when I get to the line
'Dim dataPackage As DataPackage = objectService.[Get](objectIdSet, operationOptions)'
I receive a message similar to this 'Operation output generation failed: could not retrieve data for identity: 0906249e80000e95.'
I am able to retreive related metadata content for the object.
Just wondering if there might be something I'm doing incorrectly?
Many Thanks,
allrose
Public Function getDocument(ByVal docIdentifier As String) As System.IO.FileInfo
'Setup context and service
Dim t As New EDRMDAO(_User)
t.setService()
Dim ctp As New ContentTransferProfile()
ctp.TransferMode = ContentTransferMode.MTOM
serviceContext.SetProfile(ctp)
Dim contentProfile As New ContentProfile()
contentProfile.FormatFilter = FormatFilter.ANY
Dim operationOptions As New OperationOptions()
operationOptions.ContentProfile = contentProfile
operationOptions.SetProfile(contentProfile)
Try
Dim objIdentity As New ObjectIdentity
objIdentity.Value = "0906249e80000e95" 'docIdentifier
objIdentity.ValueType = ObjectIdentityType.OBJECT_ID
objIdentity.valueTypeSpecified = True
objIdentity.RepositoryName = repository
Dim objectIdSet As New ObjectIdentitySet()
Dim objIdList As List(Of ObjectIdentity) = objectIdSet.Identities
objIdList.Add(objIdentity)
Dim dataPackage As DataPackage = objectService.[Get](objectIdSet, operationOptions)
Dim dataObj As DataObject = dataPackage.DataObjects.Item(0)
Dim resultContent As Content = dataObj.Contents.Item(0)
If resultContent.CanGetAsFile Then
Return resultContent.GetAsFile
Else
Return Nothing
End If
Catch e As Exception
Console.WriteLine(e.Message)
Console.WriteLine(e.StackTrace)
Console.WriteLine("Failed with exception " & e.Message)
Return Nothing
End Try
End Function