我一直在关注 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;