Unable to download file attachment from item using AGILE 9.3.3 CoreServices.

Hello,

I am using AGILE 9.3.3 Core Services to download attachment from an item.
I could able to retrive the filename, file size from the client code as below.
However, unable to get file downloaded in my system.
Is there anything that I need to do in addition to get file downloaded ?Please explain.

GetFileAttachmentRequestType getFileAttachmentRequestType=new GetFileAttachmentRequestType();
        AgileGetFileAttachmentRequest agileGetFileAttachmentRequest[]=new AgileGetFileAttachmentRequest[1];
        agileGetFileAttachmentRequest[0]=new AgileGetFileAttachmentRequest();
        agileGetFileAttachmentRequest[0].setClassIdentifier(“Part”);
        agileGetFileAttachmentRequest[0].setObjectNumber(partNumber);
        agileGetFileAttachmentRequest[0].setAllFiles(false);
       
        AgileFileAttachmentRequestType attachments[]=new AgileFileAttachmentRequestType[1];
        attachments[0]=new AgileFileAttachmentRequestType();
        attachments[0].setRowId(6014963);
        agileGetFileAttachmentRequest[0].setAttachments(attachments);
        getFileAttachmentRequestType.setRequests(agileGetFileAttachmentRequest);
        System.out.println(“attachments:”+attachments.getClass());
        GetFileAttachmentResponseType getFileAttachmentResponseType=agileStub.getFileAttachment(getFileAttachmentRequestType);
        System.out.println(“Response code:”+getFileAttachmentResponseType.getStatusCode()+”n”+attachments[0].getFiles());
       
       
        AgileGetFileAttachmentResponse responses[] =getFileAttachmentResponseType.getResponses();   
         AgileFileAttachmentResponseType attachmentsResp[]=responses[0].getAttachment();
         System.out.println(“FileName:”+attachmentsResp[0].getName());
      
Thanks,
Surya

Agile Talent Asked on December 28, 2016 in Software Development Kit (API),   Webservices.
Add Comment
2 Answer(s)

Have you solved this?  If so please explain how so we might have some guidance if this question comes back up.

Agile Angel Answered on February 21, 2017.
Add Comment

Hi Patrick,

Yes I solved it by converting “file content” to “byte stream” and displaying that output stream in a JSP Page.

Thanks,
Surya

Agile Talent Answered on February 22, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.