cancel
Showing results for 
Search instead for 
Did you mean: 

Adding documents to attachment node using SOAP webservices

former_member545775
Participant
0 Kudos

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>";

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member545775
Participant
0 Kudos

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

Former Member
0 Kudos

Hello Haitham,

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

Thanks & Regards,

Meghna

former_member545775
Participant
0 Kudos

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