3.1.4.10 DeleteAttachment

The DeleteAttachment operation is used to remove the attachment from the specified list item in the specified list.

 <wsdl:operation name="DeleteAttachment">
     <wsdl:input message="DeleteAttachmentSoapIn" />
     <wsdl:output message="DeleteAttachmentSoapOut" />
 </wsdl:operation>

The protocol client sends a DeleteAttachmentSoapIn request message (section 3.1.4.10.1.1) and the protocol server responds with a DeleteAttachmentSoapOut response message (section 3.1.4.10.1.2), as follows:

  1. If the listItemID does not correspond to a list item in a specified list on the site, the protocol server MUST return a SOAP fault. There is no error code for this fault.

  2. If the specified listName is a valid GUID and corresponds to the identification of a list on the site, use that list.

  3. If the specified listName is not a valid GUID or does not correspond to the identification of a list on the site, check if the listName corresponds to the list title of a list on the site and if so, use that list.

  4. If the specified listName does not correspond to a list from either of these checks, the protocol server SHOULD<47> return a SOAP fault with error code 0x82000006. This indicates that the list does not exist or might have been deleted by another user.

  5. If the specified URL does not correspond to the absolute URL path of an attachment in a specified list item in a specified list on the site, the protocol server MUST return a SOAP fault with error code 0x82000001. This indicates that the URL is missing or is invalid.

  6. If the protocol client excludes the listItemID parameter, the protocol server MUST return a SOAP fault with error code 0x82000001. Otherwise, if the protocol client excludes any of the other parameters, the protocol server MUST return a SOAP fault with no error code.

  7. If the protocol client calls the operation by passing valid input parameters, the protocol server MUST delete the attachment associated with the specified list item in the specified list.