Skip to Content

Adding documents to attachment node using SOAP webservices

Hi All,

I have a custom business object with attachment node, i want to add an image to the existing attachment folder using webservice (service operation : Update)

i followed the link : https://blogs.sap.com/2015/10/08/read-and-write-bydesign-attachments-using-web-services/ exactly but still an error occurs "key for root node is missing", any help ? below my request sample.. i cant figure out what is missing ?

"<soapenv:Envelope xmlns:soapenv=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:glob=\"http://sap.com/xi/SAPGlobal20/Global\">\n"+ "    <soapenv:Body>\n" +
" <glob:JobCardApproveJobcardUpdateRequest_sync>\n" +
" <JobCard>\n" +
" <SAP_UUID>" + jobcardUUID + "</SAP_UUID>\n" +
" <AttachmentFolder DocumentListCompleteTransmissionIndicator=\"false\" ActionCode=\"06\">\n" +
" <UUID>" + attachementFolderUUID + "</UUID>\n" +
" <Document PropertyListCompleteTransmissionIndicator=\"false\" ActionCode=\"01\">\n" +
" <VisibleIndicator>true</VisibleIndicator>\n" +
" <CategoryCode>2</CategoryCode>\n" +
" <TypeCode>10013</TypeCode>\n" +
" <MIMECode>image/png</MIMECode>\n" +
" <Name>" + name + " - After</Name>\n" +
" <FileContent>\n" +
" <BinaryObject>" + imageData + "</BinaryObject>\n" +
" </FileContent>\n" +
" </Document>\n" +
" </AttachmentFolder>\n" +
" </JobCard>\n" +
" </glob:JobCardApproveJobcardUpdateRequest_sync>\n"+ " </soapenv:Body>\n" + "</soapenv:Envelope>";
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 21 at 10:56 AM

    solved, i needed to add action code 01 in the filecontent tag

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 20 at 10:21 AM

    Hello Haitham,

    Please try using the action code "04" as suggested in the blog and make sure you pass the UUIDs.

    Thanks & Regards,

    Meghna

    Add comment
    10|10000 characters needed characters exceeded