Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Business Operation to Integrate with Amazon S3 , How to send File to Amazon S3 using HTTP Outbound

Question
Dhaval Shah · Jan 3, 2019

Business Operation to Integrate with Amazon S3 , How to send File to Amazon S3 using HTTP Outbound

Hi All,

I created a Business Operation to Integrate with Amazon S3.
I have used HTTP Outbound Adapter for the same. Used Get method of Adapter Class.
Basically in a request I want to send Unique File Name and File and in Response I want to get Version ID and if operation was successful, then set flag to true.

I have created a class for request in that I have two properties, as shown Below :
   

    Property fileName As %String;
    Property file As %GlobalBinaryStream;

This is in my Operation Class
 

            set pResponse = ##Class(SaveFileResponse).%New()
            set fileName = pRequest.fileName
            set file = pRequest.file

            set tSC = ..Adapter.Get(.HttpResponse,"filename",fileName)
            if (HttpResponse.StatusCode = 200) {
                set pResponse.fileSaved = 1
                set pResponse.fileVersionID = HttpResponse.ContentInfo
            }
            else {
                set pResponse.fileSaved = 0
            }

I have also created Business Operation in Production and configured URL and HTTP Configuration and SSL Configuration in Settings for the same.

Is this all correct ? Is my approch okay ?

Kindly help me on this . 

#Business Operation #Interoperability #Ensemble #InterSystems IRIS

Source URL:https://community.intersystems.com/post/business-operation-integrate-amazon-s3-how-send-file-amazon-s3-using-http-outbound