1

我一直在关注 Oracle 文档 E15930_01(Agile PLM Core Web Services User Manual)中包含的代码示例。这些示例使用 Java,但我已将我正在处理的项目所需的内容翻译为 .NET。

我可以搜索一个对象并返回它的附件。除了我需要的 fileDownloadUrl 之外,我可以获得所有附件属性。此字段始终为空白。

示例代码如下。我想通过将 allFiles 的属性设置为 false 并将 downloadUrl 设置为 true,我应该得到一个下载 URL,但我没有。此代码返回附件的所有属性,除了我想要的属性。对我做错了什么有任何想法吗?

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;
4

1 回答 1

0

发布这个以防其他人需要这样做,或者我需要稍后再做。

我找到了我需要的数据。下载 URL 是根据数据库中多个字段中的 XML 值生成的。它们是您正在查看的行上的文件夹名称、文件名和 FolderVersion。您需要解析 XML 并检索值以生成链接。

您可以通过“获取快捷方式”按钮获取下载链接的模式。

于 2014-10-21T17:38:21.780 回答