Attaching a Text File

When attaching a text file (a nonbinary file in printable ASCII format), no Base64 encoding is required.

The following SOAP request illustrates how a text file can be attached:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/
2001/XMLSchema">
	<soap:Body>
		<AccountWS_AccountInsert_Input xmlns="urn:crmondemand/ws/account/10/2004">
				<ListOfAccount>
					<Account>
						<Description>Account with text attachment</Description>
						<Location>Bangalore</Location>
						<AccountName>Attach Text</AccountName>
						<NumberEmployees>300</NumberEmployees>
						<ListOfAttachment>
							<Attachment>
								<FileNameOrURL>Attach Text</FileNameOrURL>
								<FileExtension>txt</FileExtension>
								<DisplayFileName>My Rantings</DisplayFileName>
								<Attachment AttachmentIsTextData="true">
								The quick brown fox jumps over the lazy dog.. 
								</Attachment>
							</Attachment>
						</ListOfAttachment>
					</Account>
				</ListOfAccount>
		</AccountWS_AccountInsert_Input>
	</soap:Body>
</soap:Envelope>

The AttachmentIsTextData attribute of the <Attachment> element has the value true to indicate that the content is plain text and that no Base64 encoding or decoding is required to be performed by the Web Services framework.