Skip to Content
0

Adding documents to attachment node using SOAP webservices

Mar 11 at 02:13 PM

42

avatar image

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>";
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Haitham Emam Mar 21 at 10:56 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Meghna Sharma Mar 20 at 10:21 AM
0

Hello Haitham,

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

Thanks & Regards,

Meghna

Show 1 Share
10 |10000 characters needed characters left characters exceeded

the blog says to use action code "06" for the existing attachment node and action code "01" for the new document

0