Webservice Payload to upload Attachments in ERP Cloud – ErpObjectAttachmentService

ERP Object Attachment Service is a generic service provided by oracle to upload text, file, and URL based attachments to business objects.


Service WSDL URL: https://servername/fscmService/ErpObjectAttachmentService?WSDL

Operation – uploadAttachment:Uploads an attachment zip file for a particular Universal Content Management Server account and updates the attachment tables for the relevant business object.


Here is an example payload to upload attachment to Journal Header.

Input Payload:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/" xmlns:erp="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:uploadAttachment>
         <typ:entityName>Journal Header</typ:entityName>
         <typ:categoryName>GL_JE_HEADERS</typ:categoryName>
         <typ:allowDuplicate>Yes</typ:allowDuplicate>
         <!--Zero or more repetitions:-->
         <typ:attachmentRows>
            <!--Optional:-->
            <!--Journal Name:-->
            <erp:UserKeyA>DR S1 Test JE Batch 001 JE2</erp:UserKeyA>
            <!--Journal Batch Name:-->
            <erp:UserKeyB>DR S1 Test JE Batch 001</erp:UserKeyB>
            <!--Default Period Name:-->
            <erp:UserKeyC>Sep-19</erp:UserKeyC>
            <!--COA Name:-->
            <erp:UserKeyD>DR CoA</erp:UserKeyD>
            <!--Calender Name:-->
            <erp:UserKeyE>DR Calendar</erp:UserKeyE>
            <!--AttachmentType:-->
            <erp:AttachmentType>File</erp:AttachmentType>
            <!--File Name:-->
            <erp:Title>SampleAttachment.txt</erp:Title>
            <!--Content:-->
            <erp:Content>U2hhaWxlbmRlciBTYW1wbGVBdHRhY2htZW50IHVwbG9hZCB0aHJvdWdoIFNPQVAgU2VydmljZQ==</erp:Content>
         </typ:attachmentRows>
      </typ:uploadAttachment>
   </soapenv:Body>
</soapenv:Envelope>
To upload attachments to ERP Cloud business objects, we need to pass UserKey as shown in the above example. Each object(Receipts, Journals, Suppliers, Purchase Orders, etc) has different combination of user keys. FUN_ERP_ATTACHMENT_CONTEXTS table will show the association of user keys in combination of different objects under the column USER_KEY_CONTEXT1. Below is the glimpse of FUN_ERP_ATTACHMENT_CONTEXTS table.

FUN_ERP_ATTACHMENT_CONTEXTS


Query in column USER_KEY_CONTEXT1 has bind parameters with name :1, :2, :3, :4, :5. Each bind parameter refers to one corresponding user key A, B, C, D, and E.
Response Payload
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
   <env:Header>
      <wsa:Action>http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService//ErpObjectAttachmentService/uploadAttachmentResponse</wsa:Action>
      <wsa:MessageID>urn:uuid:789ec13c-4b9a-49a7-afe2-f5a503051502</wsa:MessageID>
   </env:Header>
   <env:Body>
      <ns0:uploadAttachmentResponse xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/">
         <result xmlns="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/">"Attachment1":"SUCCEEDED"</result>
      </ns0:uploadAttachmentResponse>
   </env:Body>
</env:Envelope>