3.1.4.1 AddAttachment

The AddAttachment operation adds an attachment to the specified list item in the specified list.

<wsdl:operation name="AddAttachment">
    <wsdl:input message="AddAttachmentSoapIn" />
    <wsdl:output message="AddAttachmentSoapOut" />
</wsdl:operation>

The protocol client sends an AddAttachmentSoapIn request message (section 3.1.4.1.1.1) and the server responds with an AddAttachmentSoapOut response message (section 3.1.4.1.1.2), as follows:

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

  2. 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.

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

  4. 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 returned for this fault.

  5. If the specified fileName is not unique for the specified list item's attachment collection, the protocol server MUST return a SOAP fault with error code 0x81020067. This indicates that the specified fileName is already in use.

  6. If the attachment parameter value does not follow the base64Binary format, the protocol server MUST return a SOAP fault. There is no error code returned for this fault.

  7. If the protocol client requests to add an attachment of content length zero, the protocol server MUST return a SOAP fault with error code 0x8007000d.

  8. If the protocol client request excludes the listItemID parameter, the protocol server MUST return a SOAP fault with error code 0x82000001. Otherwise, if the listName or attachment parameters are missing, the protocol server MUST return a SOAP fault with no error code. Otherwise, if the fileName parameter is missing, the protocol server MUST return a SOAP fault with error code 0x81020073.

  9. If the protocol client passes valid input parameters, the protocol server MUST add the attachment to the specified list item in the specified list.