1

I've been following the code samples included in Oracle document E15930_01 (Agile PLM Core Web Services User Manual). The samples are in Java, but I've translated what I need to .NET for the project I'm working on.

I can search for an object and return its attachments. I can get all the attachment properties except the one I need, fileDownloadUrl. This field is always blank.

Sample code follows. I thought by setting the property of allFiles to false and downloadUrl to true, I should get a download URL, but I don't. This code returns all the properties for the attachment except the one I want. Any thoughts on what I'm doing wrong?

AttachmentService svc = new AttachmentService();
            svc.Credentials = credentials;

AgileGetFileAttachmentRequest[] req2 = InitializeArray<AgileGetFileAttachmentRequest>(1);

            AgileFileAttachmentRequestType[] attachments = InitializeArray<AgileFileAttachmentRequestType>(1);

            req2[0].classIdentifier = "MyIdentifier";

            req2[0].objectNumber = "1234567890";

            req2[0].allFiles = false;

            req2[0].downloadUrl = true;

            req2[0].attachments = attachments;



            attachments[0] = new AgileFileAttachmentRequestType();

            int rowId = getRowId(tt);

            attachments[0].rowId = rowId;



            GetFileAttachmentRequestType get = new GetFileAttachmentRequestType();

            get.requests = req2;

            GetFileAttachmentResponseType resp2 = svc.getFileAttachment(get);

            AgileFileAttachmentResponseType[] attchResp = InitializeArray<AgileFileAttachmentResponseType>(1);

            attchResp = resp2.responses[0].attachment;
Tim
  • 4,051
  • 10
  • 36
  • 60
  • 1
    Could you post your getRowId function? Or give me a pitch forward on http://stackoverflow.com/questions/30366817/error-when-fetching-attachments-from-oracle-agile? – President Camacho May 21 '15 at 07:08

1 Answers1

0

Posting this in case someone else needs to do this or I need to do it later.

I found the data I needed. The download URLs are generated based on XML values in several fields in the database. They're the folder name, filename and FolderVersion on the row you're looking at. You need to parse the XML and retrieve the values to generate the link.

You can get the pattern for the download link through the Get Shortcut button.

Tim
  • 4,051
  • 10
  • 36
  • 60