Attachment handling

What do the following error messages mean?

Error Message: Warning: incoming add attachment request 1 has no href attribute

Error: unable to match incoming add attachment request 1 with no href attribute to an attachment part

They indicate that the <attachment> elements in the XML in the SOAP requests do not have a href or contentId attribute value. The same value is supposed to be in the MIME message part as the Content-ID: value. In SOAP with attachments, we need a correlation between the XML element/attributes that describe the attachment, and the actual binary or base64 attachment content which is in a MIME message. This correlation is typically a unique ID specified in an href or Content-ID attribute.

The Service Manager server deliberately allows requests that omit the href or contentId and attempts to match up the XML and the attachment parts.

We report the missing href or contentId value with a message in the sm.log file, as follows:

Warning: incoming add attachment request 1 has no href attribute

The server first tries to get an href or contentId value out of the XML; if it succeeds, it finds the associated MIME attachment by looking for a MIME message part whose id has the same value. If there is no href or Content-ID, the server tries to match up the <attachment> element with a particular attachment part. This assumes that there is a one-to-one correspondence between <attachment> elements and attachment parts and uses the index of the DOM node of the <attachment> element as an index into the array of binary attachment parts.

This strategy does not work when there are miscellaneous white-space nodes in the DOM document, because the index number of the DOM node for the <attachment> element is greater than it would otherwise be.