Oracle Cloud ERP – ERPObjectAttachmentService for PurchaseOrder

Below is the Sample Request Payload for ERPObject Attachment Service : SOAP URL : https://adc2-zrej-fa-ext.oracledemos.com/fscmService/ErpObjectAttachmentService?wsdl

<soapenv:Envelope xmlns:erp="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/">
   <soapenv:Header>
      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-FCAED079FF8B56D73C16012121276596">
            <wsse:Username>FIN_IMPL</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">stT95343</wsse:Password>
            <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">pkQbvxQmcbTCEVqtOaQv/Q==</wsse:Nonce>
            <wsu:Created>2020-09-27T13:08:47.659Z</wsu:Created>
         </wsse:UsernameToken>
         <wsu:Timestamp wsu:Id="TS-FCAED079FF8B56D73C16012121244955">
            <wsu:Created>2020-09-27T13:08:44.494Z</wsu:Created>
            <wsu:Expires>2020-10-11T13:52:16.494Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <typ:uploadAttachment>
         <typ:entityName>PO_HEADERS</typ:entityName>
         <typ:categoryName>MISC</typ:categoryName>
         <typ:allowDuplicate>yes</typ:allowDuplicate>         <!--Zero or more repetitions:-->
         <typ:attachmentRows>
            <!--Optional:-->
            <erp:UserKeyA>164019</erp:UserKeyA> <!--PO Numbe -->
            <!--Optional:-->
            <erp:UserKeyB>US1 Legal Entity</erp:UserKeyB>  <!--sold to le name -->
            <!--Optional:-->
            <erp:UserKeyC>#NULL</erp:UserKeyC>
            <!--Optional:-->
            <erp:UserKeyD>#NULL</erp:UserKeyD>
            <!--Optional:-->
            <erp:UserKeyE>#NULL</erp:UserKeyE>
            <!--Optional:-->
            <erp:AttachmentType>FILE</erp:AttachmentType>
            <erp:Title>Sample.txt</erp:Title>
            <erp:Content>SGVsbG8gV29ybGQ=</erp:Content>
         </typ:attachmentRows>
      </typ:uploadAttachment>
   </soapenv:Body>
</soapenv:Envelope>

Sample Payload Response

<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:13bbaf68-cdbb-4739-8917-ffe8431e4e27</wsa:MessageID>
      <wsse:Security env:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsu:Timestamp wsu:Id="Timestamp-x01AUhAjdElYLZ1WI8CwOA22" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsu:Created>2020-09-27T13:43:15Z</wsu:Created>
            <wsu:Expires>2020-10-01T01:03:15Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </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>

BI Query to Validate the attachments

SELECT DISTINCT
    attch.pk1_value,
    attch.pk2_value,
    attch.attached_document_id,
    attch.entity_name,
    tl.dm_document_id,
	tl.dm_version_number,
	tl.dm_type,
    tl.file_name,
    tl.title,
    attch.category_name
FROM
    fnd_attached_documents  attch,
    fnd_documents_tl        tl ,
    po_headers_all ph
    WHERE attch.pk1_value =ph.po_header_id
    and ph.segment1='164019'
     AND attch.document_id = tl.document_id
     AND attch.entity_name  = 'PO_HEADERS'  
     AND attch.category_name in ('TO_SUPPLIER', 'MISC') 

Leave a Reply

Your email address will not be published.