Web Service Client Package ATTACHMENT.GETFILEATTACHMENT Gives Duplicate Content For Multiple Attachments

(Doc ID 2363514.1)

Last updated on MARCH 07, 2018

Applies to:

Oracle Agile PLM Framework - Version and later
Information in this document applies to any platform.


Web Service client package ATTACHMENT.GETFILEATTACHMENT gives duplicate content for multiple attachments.

The issue can be reproduced at will with the following steps:

1. Navigate to http://www.oracle.com/technetwork/indexes/samplecode/agile-2684218.html
2. Download 9.3.4_WS_Samples.zip
3. Find Web Service GetFileAttachment.java and rename it to Get2FileAttachments.java
4. Add Custom code:

 //============> CUSTOM ADDITION - begin
public static String fileName2 = null;
public static String fileName3 = null;
  //============> CUSTOM ADDITION - end

  //============> CUSTOM ADDITION - begin
  partNumber = args[3];
  fileName = args[4];
  if (args.length > 5) {
  fileName2 = args[5];
  if (args.length > 6) {
  fileName3 = args[6];
  //============> CUSTOM ADDITION - end

  //============> CUSTOM ADDITION - begin
  if (fileName2 != null) {
  AgileFileAttachmentRequestType attachments2 = new AgileFileAttachmentRequestType();
  attachments2.setRowId( getRowOrFileId(fileName2,
  ItemConstants.TABLE_ATTACHMENTS.toString(), "getRowId") );
  if (fileName3 != null) {
  AgileFileAttachmentRequestType attachments3 = new AgileFileAttachmentRequestType();
  attachments3.setRowId( getRowOrFileId(fileName3,
  ItemConstants.TABLE_ATTACHMENTS.toString(), "getRowId") );
  //============> CUSTOM ADDITION - end

5. Run the program, with a part that has 2 or more attachments.
6. Enter command line arguments in order: SERVER_INF, USERNAME, PASSWORD, partNumber, fileName, [fileName2, fileName3], where fileName2 and fileName3 are optional.
7. If you enter the optional fileName2 argument, or enter both fileName2 and fileName3 arguments, you will see the duplicate files.

The following symptoms are the getFileAttachment() operation of the Attachment web service. When trying to download multiple attachments of the same document in a web service call:


The content of the first attachment are returned twice in the SOAP response. And whichever the first row is, the content of the row is duplicated.


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms