0 votes

Hi there,

I'm trying to delete a file (attachment) via SOAP.

When executing the following SOAP request:

<efficy:api>
    <data id="0" operation="delete" entity="FILE" keys="123"/>
</efficy:api>

I get the following "answer":

<SOAP-ENV:Fault>
    <faultcode>Exception</faultcode>
    <faultstring>Invalid Entity for Delete</faultstring>
    <faultid/>
</SOAP-ENV:Fault>

I also tried entity="2", same effect. When logging in as the user i use to perform the SOAP request, i am able to delete the attachment without a problem. So, how can I delete a FILE entry?

Thanks in advance,
Stefan

closed with the note: Works as intended, thanks!
asked in How to by (177 points)
closed by

2 Answers

+1 vote
Best answer

A good rule is that you have to use the SOAP interface just like the user interface handles entities. How do you delete a file in Efficy? Well you edit the document, and remove the file. Then you commit. Soap is not any different, so what you miss is the edit context of the document.

I tested the SOAP example below on my test DB and that works well

<efficy:edit entity="Docu" key="161" commit="true" closecontext="true">
    <deletedetail detail="File" detailkey="286_0"/>
</efficy:edit>
answered by (6.8k points)
selected by
Great, thanks Kristof!

I already tried to delete it this way, but that didn't work too, because i didn't pass the _0. This seems to be the revision of the file, i guess.

Best,
Stefan
Ah yes, the primary key is the combination of K_FILE and VERSION, so it's kind of logic that it need to be passed.

Could you mark the questions as "Answered" please if you confirm it works
0 votes

Have you try with the entity written like this : 'File' ?

answered by (1.8k points)
Hello Stéphane,

the same goes for File.

Best,
Stefan
Welcome to Efficy Overflow, where you can ask questions and receive answers from other members of the community.
1,166 questions
1,424 answers
1,715 comments
325 users